@stream-io/video-react-native-sdk 1.31.1-beta.0 → 1.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/android/src/main/AndroidManifest.xml +1 -8
  3. package/android/src/main/AndroidManifestNew.xml +0 -11
  4. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
  5. package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
  6. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
  7. package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
  8. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +2 -6
  9. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  10. package/dist/commonjs/hooks/push/index.js +2 -0
  11. package/dist/commonjs/hooks/push/index.js.map +1 -1
  12. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
  13. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  14. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  15. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  16. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
  17. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
  18. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
  19. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  20. package/dist/commonjs/index.js +0 -1
  21. package/dist/commonjs/index.js.map +1 -1
  22. package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
  23. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  24. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  25. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  26. package/dist/commonjs/utils/StreamVideoRN/index.js +21 -35
  27. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  28. package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -53
  29. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  30. package/dist/commonjs/utils/push/android.js +202 -135
  31. package/dist/commonjs/utils/push/android.js.map +1 -1
  32. package/dist/commonjs/utils/push/internal/ios.js +34 -17
  33. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  34. package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
  35. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  36. package/dist/commonjs/utils/push/internal/utils.js +53 -71
  37. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  38. package/dist/commonjs/utils/push/ios.js.map +1 -1
  39. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  40. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  41. package/dist/commonjs/utils/push/libs/index.js +19 -8
  42. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  43. package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
  44. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  45. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  46. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  47. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
  48. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
  49. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  50. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  51. package/dist/commonjs/version.js +1 -1
  52. package/dist/commonjs/version.js.map +1 -1
  53. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +2 -6
  54. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  55. package/dist/module/hooks/push/index.js +2 -0
  56. package/dist/module/hooks/push/index.js.map +1 -1
  57. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
  58. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  59. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  60. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  61. package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
  62. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
  63. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
  64. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  65. package/dist/module/index.js +0 -1
  66. package/dist/module/index.js.map +1 -1
  67. package/dist/module/modules/call-manager/CallManager.js +0 -26
  68. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  69. package/dist/module/providers/StreamCall/index.js +6 -6
  70. package/dist/module/providers/StreamCall/index.js.map +1 -1
  71. package/dist/module/utils/StreamVideoRN/index.js +21 -35
  72. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  73. package/dist/module/utils/internal/registerSDKGlobals.js +3 -53
  74. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  75. package/dist/module/utils/push/android.js +204 -137
  76. package/dist/module/utils/push/android.js.map +1 -1
  77. package/dist/module/utils/push/internal/ios.js +34 -17
  78. package/dist/module/utils/push/internal/ios.js.map +1 -1
  79. package/dist/module/utils/push/internal/rxSubjects.js +44 -0
  80. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  81. package/dist/module/utils/push/internal/utils.js +50 -67
  82. package/dist/module/utils/push/internal/utils.js.map +1 -1
  83. package/dist/module/utils/push/ios.js.map +1 -1
  84. package/dist/module/utils/push/libs/callkeep.js +11 -0
  85. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  86. package/dist/module/utils/push/libs/index.js +2 -1
  87. package/dist/module/utils/push/libs/index.js.map +1 -1
  88. package/dist/module/utils/push/libs/notifee/index.js +18 -0
  89. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  90. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  91. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  92. package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
  93. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
  94. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  95. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  96. package/dist/module/version.js +1 -1
  97. package/dist/module/version.js.map +1 -1
  98. package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
  99. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  100. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
  101. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
  102. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  103. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
  104. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
  105. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  106. package/dist/typescript/index.d.ts +0 -1
  107. package/dist/typescript/index.d.ts.map +1 -1
  108. package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
  109. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  110. package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -22
  111. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  112. package/dist/typescript/utils/StreamVideoRN/types.d.ts +25 -59
  113. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  114. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  115. package/dist/typescript/utils/push/android.d.ts +2 -1
  116. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  117. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  118. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
  119. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  120. package/dist/typescript/utils/push/internal/utils.d.ts +8 -14
  121. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  122. package/dist/typescript/utils/push/ios.d.ts +2 -1
  123. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  124. package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
  125. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  126. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +2 -16
  127. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  128. package/dist/typescript/utils/push/libs/index.d.ts +2 -1
  129. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  130. package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
  131. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  132. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
  133. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  134. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
  135. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
  136. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  137. package/dist/typescript/version.d.ts +1 -1
  138. package/dist/typescript/version.d.ts.map +1 -1
  139. package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
  140. package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
  141. package/expo-config-plugin/dist/withAppDelegate.js +197 -19
  142. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  143. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
  144. package/ios/StreamInCallManager.m +0 -2
  145. package/ios/StreamInCallManager.swift +7 -19
  146. package/ios/StreamVideoReactNative.h +4 -7
  147. package/ios/StreamVideoReactNative.m +82 -189
  148. package/package.json +16 -11
  149. package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +2 -7
  150. package/src/hooks/push/index.ts +2 -0
  151. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
  152. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
  153. package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
  154. package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
  155. package/src/index.ts +0 -1
  156. package/src/modules/call-manager/CallManager.ts +0 -36
  157. package/src/modules/call-manager/native-module.d.ts +0 -7
  158. package/src/providers/StreamCall/index.tsx +6 -6
  159. package/src/utils/StreamVideoRN/index.ts +30 -42
  160. package/src/utils/StreamVideoRN/types.ts +25 -61
  161. package/src/utils/internal/registerSDKGlobals.ts +4 -52
  162. package/src/utils/push/android.ts +311 -198
  163. package/src/utils/push/internal/ios.ts +44 -28
  164. package/src/utils/push/internal/rxSubjects.ts +61 -0
  165. package/src/utils/push/internal/utils.ts +64 -108
  166. package/src/utils/push/ios.ts +6 -1
  167. package/src/utils/push/libs/callkeep.ts +16 -0
  168. package/src/utils/push/libs/index.ts +2 -1
  169. package/src/utils/push/libs/notifee/index.ts +27 -0
  170. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  171. package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
  172. package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
  173. package/src/version.ts +1 -1
  174. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
  175. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
  176. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -144
  177. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  178. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -68
  179. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  180. package/dist/commonjs/utils/internal/callingx/callingx.js +0 -150
  181. package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
  182. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
  183. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
  184. package/dist/commonjs/utils/push/libs/callingx.js +0 -75
  185. package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
  186. package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -105
  187. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
  188. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -137
  189. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  190. package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -61
  191. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  192. package/dist/module/utils/internal/callingx/callingx.js +0 -140
  193. package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
  194. package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
  195. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
  196. package/dist/module/utils/push/libs/callingx.js +0 -67
  197. package/dist/module/utils/push/libs/callingx.js.map +0 -1
  198. package/dist/module/utils/push/setupCallingExpEvents.js +0 -99
  199. package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
  200. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
  201. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
  202. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
  203. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
  204. package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -18
  205. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
  206. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
  207. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
  208. package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
  209. package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
  210. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
  211. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
  212. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -189
  213. package/src/utils/internal/callingx/audioSessionPromise.ts +0 -65
  214. package/src/utils/internal/callingx/callingx.ts +0 -194
  215. package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
  216. package/src/utils/push/libs/callingx.ts +0 -89
  217. package/src/utils/push/setupCallingExpEvents.ts +0 -135
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.31.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.31.0...@stream-io/video-react-native-sdk-1.31.1) (2026-04-02)
6
+
7
+ ### Dependency Updates
8
+
9
+ - `@stream-io/video-client` updated to version `1.45.0`
10
+ - `@stream-io/video-react-bindings` updated to version `1.13.15`
11
+
12
+ ### Bug Fixes
13
+
14
+ - **pins:** render the "pin" indicator regardless of "unpin" capabilities ([#2179](https://github.com/GetStream/stream-video-js/issues/2179)) ([f78cf41](https://github.com/GetStream/stream-video-js/commit/f78cf4115f7fb3f3eb799ac406c3f56cc691c942))
15
+
5
16
  ## [1.31.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.30.5...@stream-io/video-react-native-sdk-1.31.0) (2026-03-31)
6
17
 
7
18
  ### Dependency Updates
@@ -2,13 +2,6 @@
2
2
  package="com.streamvideo.reactnative">
3
3
 
4
4
  <uses-permission android:name="android.permission.INTERNET" />
5
+ <uses-permission android:name="android.permission.DEVICE_POWER" />
5
6
  <uses-permission android:name="android.permission.WAKE_LOCK" />
6
-
7
- <application>
8
- <service
9
- android:name="com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService"
10
- android:exported="false"
11
- android:stopWithTask="true"
12
- android:foregroundServiceType="mediaPlayback|camera|microphone" />
13
- </application>
14
7
  </manifest>
@@ -1,13 +1,2 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
-
3
- <uses-permission android:name="android.permission.INTERNET" />
4
- <uses-permission android:name="android.permission.WAKE_LOCK" />
5
-
6
- <application>
7
- <service
8
- android:name="com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService"
9
- android:exported="false"
10
- android:stopWithTask="true"
11
- android:foregroundServiceType="mediaPlayback|camera|microphone" />
12
- </application>
13
2
  </manifest>
@@ -17,7 +17,6 @@ import android.os.Build
17
17
  import android.os.PowerManager
18
18
  import android.util.Base64
19
19
  import android.util.Log
20
- import androidx.core.content.ContextCompat
21
20
  import com.facebook.react.bridge.Arguments
22
21
  import com.facebook.react.bridge.Promise
23
22
  import com.facebook.react.bridge.ReactApplicationContext
@@ -28,8 +27,8 @@ import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEm
28
27
  import com.oney.WebRTCModule.WebRTCModule
29
28
  import com.oney.WebRTCModule.WebRTCModuleOptions
30
29
  import com.streamvideo.reactnative.screenshare.ScreenAudioCapture
31
- import com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService
32
30
  import com.streamvideo.reactnative.util.CallAlivePermissionsHelper
31
+ import com.streamvideo.reactnative.util.CallAliveServiceChecker
33
32
  import com.streamvideo.reactnative.util.PiPHelper
34
33
  import com.streamvideo.reactnative.util.RingtoneUtil
35
34
  import com.streamvideo.reactnative.util.YuvFrame
@@ -123,47 +122,11 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) :
123
122
  promise.resolve(false)
124
123
  return
125
124
  }
126
- // Service is declared in the SDK's own AndroidManifest and merged by default.
127
- // Permissions are expected to be provided by the app (or via Expo config plugin).
128
- promise.resolve(true)
129
- }
130
-
131
-
132
- @ReactMethod
133
- fun startKeepCallAliveService(
134
- callCid: String,
135
- channelId: String,
136
- channelName: String,
137
- title: String,
138
- body: String,
139
- smallIconName: String?,
140
- promise: Promise
141
- ) {
142
- try {
143
- val intent = StreamCallKeepAliveHeadlessService.buildStartIntent(
144
- reactApplicationContext,
145
- callCid,
146
- channelId,
147
- channelName,
148
- title,
149
- body,
150
- smallIconName
151
- )
152
- ContextCompat.startForegroundService(reactApplicationContext, intent)
125
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
126
+ val isForegroundServiceDeclared = CallAliveServiceChecker.isForegroundServiceDeclared(reactApplicationContext)
127
+ promise.resolve(isForegroundServiceDeclared)
128
+ } else {
153
129
  promise.resolve(true)
154
- } catch (e: Exception) {
155
- promise.reject(NAME, "Failed to start keep call alive foreground service", e)
156
- }
157
- }
158
-
159
- @ReactMethod
160
- fun stopKeepCallAliveService(promise: Promise) {
161
- try {
162
- val intent = StreamCallKeepAliveHeadlessService.buildStopIntent(reactApplicationContext)
163
- val stopped = reactApplicationContext.stopService(intent)
164
- promise.resolve(stopped)
165
- } catch (e: Exception) {
166
- promise.reject(NAME, "Failed to stop keep call alive foreground service", e)
167
130
  }
168
131
  }
169
132
 
@@ -55,78 +55,14 @@ object WebRtcAudioUtils {
55
55
  * what might be the root cause.
56
56
  */
57
57
  fun logAudioState(tag: String, reactContext: ReactContext) {
58
- Log.d(tag, getAudioStateLog(reactContext))
59
- }
60
-
61
- /**
62
- * Returns a string containing information about the current audio state.
63
- * Similar to logAudioState but returns the information instead of logging it.
64
- */
65
- fun getAudioStateLog(reactContext: ReactContext): String {
66
- val audioManager = reactContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
67
- val sb = StringBuilder()
68
-
69
- // Volume control stream
70
58
  reactContext.currentActivity?.let {
71
- sb.appendLine("volumeControlStream: ${streamTypeToString(it.volumeControlStream)}")
59
+ Log.d(tag, "volumeControlStream: " + streamTypeToString(it.volumeControlStream))
72
60
  }
73
-
74
- // Device info
75
- sb.appendLine("Android SDK: ${Build.VERSION.SDK_INT}, Release: ${Build.VERSION.RELEASE}, Brand: ${Build.BRAND}, Device: ${Build.DEVICE}, Id: ${Build.ID}, Hardware: ${Build.HARDWARE}, Manufacturer: ${Build.MANUFACTURER}, Model: ${Build.MODEL}, Product: ${Build.PRODUCT}")
76
-
77
- // Basic audio state
78
- sb.appendLine("Audio State: audio mode: ${modeToString(audioManager.mode)}, has mic: ${hasMicrophone(reactContext)}, mic muted: ${audioManager.isMicrophoneMute}, music active: ${audioManager.isMusicActive}, speakerphone: ${audioManager.isSpeakerphoneOn}, BT SCO: ${audioManager.isBluetoothScoOn}")
79
-
80
- // Volume info
81
- val fixedVolume = audioManager.isVolumeFixed
82
- sb.appendLine(" fixed volume=$fixedVolume")
83
- if (!fixedVolume) {
84
- val streams = intArrayOf(
85
- AudioManager.STREAM_VOICE_CALL,
86
- AudioManager.STREAM_MUSIC,
87
- AudioManager.STREAM_RING,
88
- AudioManager.STREAM_ALARM,
89
- AudioManager.STREAM_NOTIFICATION,
90
- AudioManager.STREAM_SYSTEM
91
- )
92
- for (stream in streams) {
93
- val info = StringBuilder()
94
- info.append(" ${streamTypeToString(stream)}: ")
95
- info.append("volume=${audioManager.getStreamVolume(stream)}")
96
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
97
- info.append(", min=${audioManager.getStreamMinVolume(stream)}")
98
- }
99
- info.append(", max=${audioManager.getStreamMaxVolume(stream)}")
100
- info.append(", muted=${audioManager.isStreamMute(stream)}")
101
- sb.appendLine(info.toString())
102
- }
103
- }
104
-
105
- // Audio devices
106
- val inputDevices = audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)
107
- val outputDevices = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)
108
- val devices = inputDevices + outputDevices
109
- if (devices.isNotEmpty()) {
110
- sb.appendLine("Audio Devices:")
111
- for (device in devices) {
112
- val info = StringBuilder()
113
- info.append(" ${deviceTypeToString(device.type)}")
114
- info.append(if (device.isSource) "(in): " else "(out): ")
115
- if (device.channelCounts.isNotEmpty()) {
116
- info.append("channels=${device.channelCounts.contentToString()}, ")
117
- }
118
- if (device.encodings.isNotEmpty()) {
119
- info.append("encodings=${device.encodings.contentToString()}, ")
120
- }
121
- if (device.sampleRates.isNotEmpty()) {
122
- info.append("sample rates=${device.sampleRates.contentToString()}, ")
123
- }
124
- info.append("id=${device.id}")
125
- sb.appendLine(info.toString())
126
- }
127
- }
128
-
129
- return sb.toString()
61
+ val audioManager = reactContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
62
+ logDeviceInfo(tag)
63
+ logAudioStateBasic(tag, reactContext, audioManager)
64
+ logAudioStateVolume(tag, audioManager)
65
+ logAudioDeviceInfo(tag, audioManager)
130
66
  }
131
67
 
132
68
  /** Converts AudioDeviceInfo types to local string representation. */
@@ -168,12 +168,10 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
168
168
 
169
169
  @ReactMethod
170
170
  fun logAudioState() {
171
- Log.d(TAG, getAudioStateLog())
172
- }
173
-
174
- @ReactMethod(isBlockingSynchronousMethod = true)
175
- fun getAudioStateLog(): String {
176
- return WebRtcAudioUtils.getAudioStateLog(reactApplicationContext)
171
+ WebRtcAudioUtils.logAudioState(
172
+ TAG,
173
+ reactApplicationContext,
174
+ )
177
175
  }
178
176
 
179
177
  @Suppress("unused")
@@ -0,0 +1,95 @@
1
+ package com.streamvideo.reactnative.util
2
+
3
+ import android.content.ComponentName
4
+ import android.content.pm.PackageManager
5
+ import android.content.pm.ServiceInfo
6
+ import android.os.Build
7
+ import android.util.Log
8
+ import androidx.annotation.RequiresApi
9
+ import com.facebook.react.bridge.ReactApplicationContext
10
+
11
+ @RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
12
+ object CallAliveServiceChecker {
13
+ private const val NAME = "StreamVideoReactNative"
14
+
15
+ fun isForegroundServiceDeclared(context: ReactApplicationContext): Boolean {
16
+ val packageManager = context.packageManager
17
+ val packageName = context.packageName // Get the package name of your app
18
+ val componentName = ComponentName(
19
+ packageName,
20
+ "app.notifee.core.ForegroundService"
21
+ ) // Use service name string
22
+
23
+ try {
24
+ val serviceInfo =
25
+ packageManager.getServiceInfo(componentName, PackageManager.GET_META_DATA)
26
+
27
+ val expectedForegroundServiceTypes =
28
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE or
29
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK or
30
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA or
31
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
32
+
33
+ val actualForegroundServiceTypes = serviceInfo.foregroundServiceType
34
+
35
+ if (actualForegroundServiceTypes == expectedForegroundServiceTypes) {
36
+ return true
37
+ } else {
38
+ Log.w(
39
+ NAME,
40
+ "android:foregroundServiceType does not match: expected=${
41
+ foregroundServiceTypeToString(
42
+ expectedForegroundServiceTypes
43
+ )
44
+ }, actual=${foregroundServiceTypeToString(actualForegroundServiceTypes)}"
45
+ )
46
+ return false
47
+ }
48
+
49
+ } catch (e: PackageManager.NameNotFoundException) {
50
+ Log.d(NAME, "Service not found: " + e.message)
51
+ return false // Service not declared
52
+ }
53
+ }
54
+
55
+ private fun foregroundServiceTypeToString(foregroundServiceType: Int): String {
56
+ val types = mutableListOf<String>()
57
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE != 0) {
58
+ types.add("shortService")
59
+ }
60
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC != 0) {
61
+ types.add("dataSync")
62
+ }
63
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA != 0) {
64
+ types.add("camera")
65
+ }
66
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE != 0) {
67
+ types.add("microphone")
68
+ }
69
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE != 0) {
70
+ types.add("connectedDevice")
71
+ }
72
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION != 0) {
73
+ types.add("location")
74
+ }
75
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK != 0) {
76
+ types.add("mediaPlayback")
77
+ }
78
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION != 0) {
79
+ types.add("mediaProjection")
80
+ }
81
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL != 0) {
82
+ types.add("phoneCall")
83
+ }
84
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_HEALTH != 0) {
85
+ types.add("health")
86
+ }
87
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING != 0) {
88
+ types.add("remoteMessaging")
89
+ }
90
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED != 0) {
91
+ types.add("systemExempted")
92
+ }
93
+ return types.joinToString("|")
94
+ }
95
+ }
@@ -57,13 +57,9 @@ const ParticipantLabel = ({
57
57
  } = (0, _videoReactBindings.useI18n)();
58
58
  const participantName = name ?? userId;
59
59
  const participantLabel = isLocalParticipant ? t('You') : participantName;
60
- const isPinningEnabled = pin?.isLocalPin;
61
60
  const isAudioMuted = !(0, _videoClient.hasAudio)(participant);
62
61
  const isVideoMuted = !(0, _videoClient.hasVideo)(participant);
63
62
  const isTrackPaused = trackType && (0, _videoClient.hasPausedTrack)(participant, trackType);
64
- const unPinParticipantHandler = () => {
65
- call?.unpin(sessionId);
66
- };
67
63
  if (trackType === 'screenShareTrack') {
68
64
  const screenShareText = isLocalParticipant ? t('You are sharing your screen') : t('{{ userName }} is sharing their screen', {
69
65
  userName: participantName
@@ -111,9 +107,9 @@ const ParticipantLabel = ({
111
107
  }, /*#__PURE__*/_react.default.createElement(_icons.BadNetwork, {
112
108
  color: colors.iconPrimary,
113
109
  size: iconSizes.sm
114
- })), isPinningEnabled && /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
110
+ })), pin && /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
115
111
  style: [styles.pinIconContainer, pinIconContainer],
116
- onPress: unPinParticipantHandler
112
+ onPress: pin.isLocalPin ? () => call?.unpin(sessionId) : undefined
117
113
  }, /*#__PURE__*/_react.default.createElement(_icons.PinVertical, {
118
114
  color: colors.iconPrimary,
119
115
  size: iconSizes.sm
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_icons","_videoReactBindings","_TestIds","_constants","_videoClient","_ThemeContext","_SpeechIndicator","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ParticipantLabel","participant","trackType","theme","colors","typefaces","variants","iconSizes","participantLabel","container","userNameLabel","audioMutedIconContainer","videoMutedIconContainer","pinIconContainer","screenShareIconContainer","useTheme","styles","useStyles","name","userId","pin","sessionId","isLocalParticipant","useCall","useI18n","participantName","isPinningEnabled","isLocalPin","isAudioMuted","hasAudio","isVideoMuted","hasVideo","isTrackPaused","hasPausedTrack","unPinParticipantHandler","unpin","screenShareText","userName","createElement","View","style","backgroundColor","sheetOverlay","testID","ComponentTestIds","PARTICIPANT_SCREEN_SHARING","height","md","width","ScreenShareIndicator","color","iconPrimary","Text","textPrimary","caption","numberOfLines","wrapper","MicOff","size","sm","VideoSlash","trackPausedIconContainer","BadNetwork","Pressable","onPress","PinVertical","indicatorWrapper","isSpeaking","isDominantSpeaker","exports","useMemo","StyleSheet","create","marginLeft","spacingSizes","flexDirection","alignItems","padding","maxHeight","borderTopRightRadius","marginBottom","flexShrink","zIndex","Z_INDEX","IN_FRONT","marginTop","fontSize","fontWeight","marginRight","justifyContent","xs"],"sourceRoot":"../../../../../src","sources":["components/Participant/ParticipantView/ParticipantLabel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AAAgD,SAAAS,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,gBAAAG,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAG,CAAA,OAAAK,CAAA,IAAAD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AS,EAAE;MACTkE,aAAa,EAAE,KAAK;MACpBC,UAAU,EAAE,QAAQ;MACpBC,OAAO,EAAE1E,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACf,EAAE;MACvCmB,SAAS,EAAE,EAAE;MACbC,oBAAoB,EAAE,CAAC;MACvBC,YAAY,EAAE,CAAC,CAAC;MAChBC,UAAU,EAAE,CAAC;MACbC,MAAM,EAAEC,kBAAO,CAACC;IAClB,CAAC;IACD1E,aAAa,EAAE;MACbuE,UAAU,EAAE,CAAC;MACbI,SAAS,EAAE,CAAC;MACZC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE,KAAK;MACjBrC,KAAK,EAAE/C,KAAK,CAACC,MAAM,CAACiD;IACtB,CAAC;IACDvC,wBAAwB,EAAE;MACxB0E,WAAW,EAAErF,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACf,EAAE;MAC3C8B,cAAc,EAAE;IAClB,CAAC;IACD9E,uBAAuB,EAAE;MACvB8D,UAAU,EAAEtE,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD7E,uBAAuB,EAAE;MACvB6D,UAAU,EAAEtE,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD5B,wBAAwB,EAAE;MACxBY,UAAU,EAAEtE,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD5E,gBAAgB,EAAE;MAChB4D,UAAU,EAAEtE,KAAK,CAACG,QAAQ,CAACoE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB;EACF,CAAC,CAAC,EACJ,CAACtF,KAAK,CACR,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_icons","_videoReactBindings","_TestIds","_constants","_videoClient","_ThemeContext","_SpeechIndicator","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ParticipantLabel","participant","trackType","theme","colors","typefaces","variants","iconSizes","participantLabel","container","userNameLabel","audioMutedIconContainer","videoMutedIconContainer","pinIconContainer","screenShareIconContainer","useTheme","styles","useStyles","name","userId","pin","sessionId","isLocalParticipant","useCall","useI18n","participantName","isAudioMuted","hasAudio","isVideoMuted","hasVideo","isTrackPaused","hasPausedTrack","screenShareText","userName","createElement","View","style","backgroundColor","sheetOverlay","testID","ComponentTestIds","PARTICIPANT_SCREEN_SHARING","height","md","width","ScreenShareIndicator","color","iconPrimary","Text","textPrimary","caption","numberOfLines","wrapper","MicOff","size","sm","VideoSlash","trackPausedIconContainer","BadNetwork","Pressable","onPress","isLocalPin","unpin","undefined","PinVertical","indicatorWrapper","isSpeaking","isDominantSpeaker","exports","useMemo","StyleSheet","create","marginLeft","spacingSizes","flexDirection","alignItems","padding","maxHeight","borderTopRightRadius","marginBottom","flexShrink","zIndex","Z_INDEX","IN_FRONT","marginTop","fontSize","fontWeight","marginRight","justifyContent","xs"],"sourceRoot":"../../../../../src","sources":["components/Participant/ParticipantView/ParticipantLabel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AAAgD,SAAAS,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBA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,QAAQ,CAACmE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD5E,uBAAuB,EAAE;MACvB4D,UAAU,EAAErE,KAAK,CAACG,QAAQ,CAACmE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD/B,wBAAwB,EAAE;MACxBe,UAAU,EAAErE,KAAK,CAACG,QAAQ,CAACmE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB,CAAC;IACD3E,gBAAgB,EAAE;MAChB2D,UAAU,EAAErE,KAAK,CAACG,QAAQ,CAACmE,YAAY,CAACgB,EAAE;MAC1CD,cAAc,EAAE;IAClB;EACF,CAAC,CAAC,EACJ,CAACrF,KAAK,CACR,CAAC;AACH,CAAC","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.usePushRegisterEffect = void 0;
7
7
  var _useIosVoipPushEventsSetupEffect = require("./useIosVoipPushEventsSetupEffect");
8
+ var _useProcessPushCallEffect = require("./useProcessPushCallEffect");
8
9
  var _useInitAndroidTokenAndRest = require("./useInitAndroidTokenAndRest");
9
10
  var _useIosInitRemoteNotifications = require("./useIosInitRemoteNotifications");
10
11
  var _useProcessPushNonRingingCallEffect = require("./useProcessPushNonRingingCallEffect");
@@ -16,6 +17,7 @@ const usePushRegisterEffect = () => {
16
17
  (0, _useIosInitRemoteNotifications.useIosInitRemoteNotifications)();
17
18
  (0, _useIosVoipPushEventsSetupEffect.useIosVoipPushEventsSetupEffect)();
18
19
  (0, _useProcessPushNonRingingCallEffect.useProcessPushNonRingingCallEffect)();
20
+ (0, _useProcessPushCallEffect.useProcessPushCallEffect)();
19
21
  (0, _useInitAndroidTokenAndRest.useInitAndroidTokenAndRest)();
20
22
  };
21
23
  exports.usePushRegisterEffect = usePushRegisterEffect;
@@ -1 +1 @@
1
- {"version":3,"names":["_useIosVoipPushEventsSetupEffect","require","_useInitAndroidTokenAndRest","_useIosInitRemoteNotifications","_useProcessPushNonRingingCallEffect","usePushRegisterEffect","useIosInitRemoteNotifications","useIosVoipPushEventsSetupEffect","useProcessPushNonRingingCallEffect","useInitAndroidTokenAndRest","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":";;;;;;AAAA,IAAAA,gCAAA,GAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAF,OAAA;AACA,IAAAG,mCAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAGA,CAAA,KAAM;EACzC,IAAAC,4DAA6B,EAAC,CAAC;EAC/B,IAAAC,gEAA+B,EAAC,CAAC;EACjC,IAAAC,sEAAkC,EAAC,CAAC;EACpC,IAAAC,sDAA0B,EAAC,CAAC;AAC9B,CAAC;AAACC,OAAA,CAAAL,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useIosVoipPushEventsSetupEffect","require","_useProcessPushCallEffect","_useInitAndroidTokenAndRest","_useIosInitRemoteNotifications","_useProcessPushNonRingingCallEffect","usePushRegisterEffect","useIosInitRemoteNotifications","useIosVoipPushEventsSetupEffect","useProcessPushNonRingingCallEffect","useProcessPushCallEffect","useInitAndroidTokenAndRest","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":";;;;;;AAAA,IAAAA,gCAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,mCAAA,GAAAJ,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMK,qBAAqB,GAAGA,CAAA,KAAM;EACzC,IAAAC,4DAA6B,EAAC,CAAC;EAC/B,IAAAC,gEAA+B,EAAC,CAAC;EACjC,IAAAC,sEAAkC,EAAC,CAAC;EACpC,IAAAC,kDAAwB,EAAC,CAAC;EAC1B,IAAAC,sDAA0B,EAAC,CAAC;AAC9B,CAAC;AAACC,OAAA,CAAAN,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useIosCallkeepWithCallingStateEffect = void 0;
7
+ var _videoClient = require("@stream-io/video-client");
8
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
9
+ var _reactNative = require("react-native");
10
+ var _react = require("react");
11
+ var _utils = require("../../utils");
12
+ var _libs = require("../../utils/push/libs");
13
+ var _rxSubjects = require("../../utils/push/internal/rxSubjects");
14
+ const isNonActiveCallingState = callingState => {
15
+ return callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.UNKNOWN || callingState === _videoClient.CallingState.LEFT;
16
+ };
17
+ const isAcceptedCallingState = callingState => {
18
+ return callingState === _videoClient.CallingState.JOINING || callingState === _videoClient.CallingState.JOINED;
19
+ };
20
+ const unsubscribeCallkeepEvents = async activeCallCid => {
21
+ const voipPushNotificationCallCId = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipPushNotificationCallCId$);
22
+ if (activeCallCid && activeCallCid === voipPushNotificationCallCId) {
23
+ // callkeep events should not be listened anymore so clear the call cid
24
+ _rxSubjects.voipPushNotificationCallCId$.next(undefined);
25
+ }
26
+ return await _reactNative.NativeModules.StreamVideoReactNative?.removeIncomingCall(activeCallCid);
27
+ };
28
+ const logger = _videoClient.videoLoggerSystem.getLogger('useIosCallkeepWithCallingStateEffect');
29
+ const log = message => {
30
+ logger.warn(message);
31
+ };
32
+
33
+ /**
34
+ * This hook is used to inform the callkeep library that the call has been joined or ended.
35
+ */
36
+ const useIosCallkeepWithCallingStateEffect = () => {
37
+ const activeCall = (0, _videoReactBindings.useCall)();
38
+ const {
39
+ useCallCallingState
40
+ } = (0, _videoReactBindings.useCallStateHooks)();
41
+ const callingState = useCallCallingState();
42
+ const [acceptedForegroundCallkeepMap, setAcceptedForegroundCallkeepMap] = (0, _react.useState)();
43
+ (0, _react.useEffect)(() => {
44
+ return () => {
45
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
46
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios?.pushProviderName) {
47
+ return;
48
+ }
49
+ if (!pushConfig.android.incomingCallChannel) {
50
+ // TODO: remove this check and find a better way once we have telecom integration for android
51
+ return;
52
+ }
53
+ const callkeep = (0, _libs.getCallKeepLib)();
54
+ // if the component is unmounted and the callID was not reported to callkeep, then report it now
55
+ if (acceptedForegroundCallkeepMap) {
56
+ log(`Ending call in callkeep: ${acceptedForegroundCallkeepMap.cid}, reason: component unmounted and call was present in acceptedForegroundCallkeepMap`);
57
+ unsubscribeCallkeepEvents(acceptedForegroundCallkeepMap.cid).then(() => callkeep.endCall(acceptedForegroundCallkeepMap.uuid));
58
+ }
59
+ };
60
+ }, [acceptedForegroundCallkeepMap]);
61
+ const activeCallCid = activeCall?.cid;
62
+ (0, _react.useEffect)(() => {
63
+ return () => {
64
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
65
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios?.pushProviderName || !activeCallCid) {
66
+ return;
67
+ }
68
+ if (!pushConfig.android.incomingCallChannel) {
69
+ // TODO: remove this check and find a better way once we have telecom integration for android
70
+ return;
71
+ }
72
+ const nativeDialerAcceptedCallMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$);
73
+ const foregroundIncomingCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
74
+ const callkeep = (0, _libs.getCallKeepLib)();
75
+ if (activeCallCid === nativeDialerAcceptedCallMap?.cid) {
76
+ log(`Ending call in callkeep: ${activeCallCid}, reason: activeCallCid changed or was removed and call was present in nativeDialerAcceptedCallMap`);
77
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(nativeDialerAcceptedCallMap.uuid));
78
+ // no need to keep this reference anymore
79
+ _rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
80
+ } else if (activeCallCid === foregroundIncomingCallkeepMap?.cid) {
81
+ log(`Ending call in callkeep: ${activeCallCid}, reason: activeCallCid changed or was removed and call was present in foregroundIncomingCallkeepMap`);
82
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(foregroundIncomingCallkeepMap.uuid));
83
+ }
84
+ };
85
+ }, [activeCallCid]);
86
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
87
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios.pushProviderName || !activeCallCid) {
88
+ return;
89
+ }
90
+ if (!pushConfig.android.incomingCallChannel) {
91
+ // TODO: remove this check and find a better way once we have telecom integration for android
92
+ return;
93
+ }
94
+
95
+ /**
96
+ * Check if current call is still needed to be accepted in callkeep
97
+ */
98
+ if (isAcceptedCallingState(callingState) && acceptedForegroundCallkeepMap?.cid !== activeCallCid) {
99
+ const callkeep = (0, _libs.getCallKeepLib)();
100
+ // push notification was displayed
101
+ // but the call has been accepted through the app and not through the native dialer
102
+ const foregroundCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
103
+ if (foregroundCallkeepMap && foregroundCallkeepMap.cid === activeCallCid) {
104
+ log(
105
+ // @ts-expect-error - types issue
106
+ `Accepting call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in foregroundCallkeepMap`);
107
+ // no need to keep this reference anymore
108
+ _rxSubjects.voipCallkeepCallOnForegroundMap$.next(undefined);
109
+ _reactNative.NativeModules.StreamVideoReactNative?.removeIncomingCall(activeCallCid).then(() => callkeep.answerIncomingCall(foregroundCallkeepMap.uuid));
110
+ // this call should be accepted in callkeep
111
+ setAcceptedForegroundCallkeepMap(foregroundCallkeepMap);
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Check if current call is still needed to be ended in callkeep
117
+ */
118
+ if (isNonActiveCallingState(callingState)) {
119
+ const callkeep = (0, _libs.getCallKeepLib)();
120
+
121
+ // this was a previously joined call which had push notification displayed
122
+ // the call was accepted through the app and not through native dialer
123
+ // the call was left using the leave button in the app and not through native dialer
124
+ if (activeCallCid === acceptedForegroundCallkeepMap?.cid) {
125
+ log(
126
+ // @ts-expect-error - types issue
127
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in acceptedForegroundCallkeepMap`);
128
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(acceptedForegroundCallkeepMap.uuid));
129
+ setAcceptedForegroundCallkeepMap(undefined);
130
+ return;
131
+ }
132
+ // this was a call which had push notification displayed but never joined
133
+ // the user rejected in the app and not from native dialer
134
+ const foregroundIncomingCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
135
+ if (activeCallCid === foregroundIncomingCallkeepMap?.cid) {
136
+ log(
137
+ // @ts-expect-error - types issue
138
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in foregroundIncomingCallkeepMap`);
139
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(foregroundIncomingCallkeepMap.uuid));
140
+ // no need to keep this reference anymore
141
+ _rxSubjects.voipCallkeepCallOnForegroundMap$.next(undefined);
142
+ return;
143
+ }
144
+ // this was a previously joined call
145
+ // it was an accepted call from native dialer and not from the app
146
+ // the user left using the leave button in the app
147
+ const nativeDialerAcceptedCallMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$);
148
+ if (activeCallCid === nativeDialerAcceptedCallMap?.cid) {
149
+ log(
150
+ // @ts-expect-error - types issue
151
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in nativeDialerAcceptedCallMap`);
152
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(nativeDialerAcceptedCallMap.uuid));
153
+ // no need to keep this reference anymore
154
+ _rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
155
+ return;
156
+ }
157
+ }
158
+ };
159
+ exports.useIosCallkeepWithCallingStateEffect = useIosCallkeepWithCallingStateEffect;
160
+ //# sourceMappingURL=useIosCallkeepWithCallingStateEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_videoClient","require","_videoReactBindings","_reactNative","_react","_utils","_libs","_rxSubjects","isNonActiveCallingState","callingState","CallingState","IDLE","UNKNOWN","LEFT","isAcceptedCallingState","JOINING","JOINED","unsubscribeCallkeepEvents","activeCallCid","voipPushNotificationCallCId","RxUtils","getCurrentValue","voipPushNotificationCallCId$","next","undefined","NativeModules","StreamVideoReactNative","removeIncomingCall","logger","videoLoggerSystem","getLogger","log","message","warn","useIosCallkeepWithCallingStateEffect","activeCall","useCall","useCallCallingState","useCallStateHooks","acceptedForegroundCallkeepMap","setAcceptedForegroundCallkeepMap","useState","useEffect","pushConfig","StreamVideoRN","getConfig","push","Platform","OS","ios","pushProviderName","android","incomingCallChannel","callkeep","getCallKeepLib","cid","then","endCall","uuid","nativeDialerAcceptedCallMap","voipCallkeepAcceptedCallOnNativeDialerMap$","foregroundIncomingCallkeepMap","voipCallkeepCallOnForegroundMap$","foregroundCallkeepMap","answerIncomingCall","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosCallkeepWithCallingStateEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAMA,MAAMO,uBAAuB,GAAIC,YAA0B,IAAK;EAC9D,O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