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

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 (248) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/android/src/main/AndroidManifest.xml +8 -1
  3. package/android/src/main/AndroidManifestNew.xml +11 -0
  4. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +127 -5
  5. package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +70 -6
  6. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +6 -4
  7. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +83 -0
  8. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +149 -0
  9. package/android/src/main/java/com/streamvideo/reactnative/screenshare/ScreenAudioCapture.kt +111 -0
  10. package/dist/commonjs/components/Call/CallControls/ScreenShareToggleButton.js +3 -2
  11. package/dist/commonjs/components/Call/CallControls/ScreenShareToggleButton.js.map +1 -1
  12. package/dist/commonjs/hooks/index.js +11 -0
  13. package/dist/commonjs/hooks/index.js.map +1 -1
  14. package/dist/commonjs/hooks/push/index.js +0 -2
  15. package/dist/commonjs/hooks/push/index.js.map +1 -1
  16. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +144 -0
  17. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
  18. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
  19. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  20. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +64 -97
  21. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  22. package/dist/commonjs/hooks/useScreenShareAudioMixing.js +126 -0
  23. package/dist/commonjs/hooks/useScreenShareAudioMixing.js.map +1 -0
  24. package/dist/commonjs/hooks/useScreenShareButton.js +57 -3
  25. package/dist/commonjs/hooks/useScreenShareButton.js.map +1 -1
  26. package/dist/commonjs/index.js +1 -0
  27. package/dist/commonjs/index.js.map +1 -1
  28. package/dist/commonjs/modules/ScreenShareAudioManager.js +54 -0
  29. package/dist/commonjs/modules/ScreenShareAudioManager.js.map +1 -0
  30. package/dist/commonjs/modules/call-manager/CallManager.js +26 -0
  31. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  32. package/dist/commonjs/providers/StreamCall/index.js +16 -6
  33. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  34. package/dist/commonjs/utils/StreamVideoRN/index.js +35 -21
  35. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  36. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +68 -0
  37. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +1 -0
  38. package/dist/commonjs/utils/internal/callingx/callingx.js +150 -0
  39. package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -0
  40. package/dist/commonjs/utils/internal/registerSDKGlobals.js +53 -3
  41. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  42. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +48 -0
  43. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +1 -0
  44. package/dist/commonjs/utils/push/android.js +135 -202
  45. package/dist/commonjs/utils/push/android.js.map +1 -1
  46. package/dist/commonjs/utils/push/internal/ios.js +17 -34
  47. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  48. package/dist/commonjs/utils/push/internal/rxSubjects.js +1 -45
  49. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  50. package/dist/commonjs/utils/push/internal/utils.js +71 -53
  51. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  52. package/dist/commonjs/utils/push/ios.js.map +1 -1
  53. package/dist/commonjs/utils/push/libs/callingx.js +75 -0
  54. package/dist/commonjs/utils/push/libs/callingx.js.map +1 -0
  55. package/dist/commonjs/utils/push/libs/index.js +8 -19
  56. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  57. package/dist/commonjs/utils/push/libs/notifee/index.js +0 -19
  58. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  59. package/dist/commonjs/utils/push/setupCallingExpEvents.js +105 -0
  60. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -0
  61. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +7 -6
  62. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  63. package/dist/commonjs/version.js +1 -1
  64. package/dist/commonjs/version.js.map +1 -1
  65. package/dist/module/components/Call/CallControls/ScreenShareToggleButton.js +3 -2
  66. package/dist/module/components/Call/CallControls/ScreenShareToggleButton.js.map +1 -1
  67. package/dist/module/hooks/index.js +1 -0
  68. package/dist/module/hooks/index.js.map +1 -1
  69. package/dist/module/hooks/push/index.js +0 -2
  70. package/dist/module/hooks/push/index.js.map +1 -1
  71. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +137 -0
  72. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
  73. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
  74. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  75. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +66 -99
  76. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  77. package/dist/module/hooks/useScreenShareAudioMixing.js +119 -0
  78. package/dist/module/hooks/useScreenShareAudioMixing.js.map +1 -0
  79. package/dist/module/hooks/useScreenShareButton.js +57 -3
  80. package/dist/module/hooks/useScreenShareButton.js.map +1 -1
  81. package/dist/module/index.js +1 -0
  82. package/dist/module/index.js.map +1 -1
  83. package/dist/module/modules/ScreenShareAudioManager.js +47 -0
  84. package/dist/module/modules/ScreenShareAudioManager.js.map +1 -0
  85. package/dist/module/modules/call-manager/CallManager.js +26 -0
  86. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  87. package/dist/module/providers/StreamCall/index.js +16 -6
  88. package/dist/module/providers/StreamCall/index.js.map +1 -1
  89. package/dist/module/utils/StreamVideoRN/index.js +35 -21
  90. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  91. package/dist/module/utils/internal/callingx/audioSessionPromise.js +61 -0
  92. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +1 -0
  93. package/dist/module/utils/internal/callingx/callingx.js +140 -0
  94. package/dist/module/utils/internal/callingx/callingx.js.map +1 -0
  95. package/dist/module/utils/internal/registerSDKGlobals.js +53 -3
  96. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  97. package/dist/module/utils/keepCallAliveHeadlessTask.js +42 -0
  98. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +1 -0
  99. package/dist/module/utils/push/android.js +137 -204
  100. package/dist/module/utils/push/android.js.map +1 -1
  101. package/dist/module/utils/push/internal/ios.js +17 -34
  102. package/dist/module/utils/push/internal/ios.js.map +1 -1
  103. package/dist/module/utils/push/internal/rxSubjects.js +0 -44
  104. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  105. package/dist/module/utils/push/internal/utils.js +67 -50
  106. package/dist/module/utils/push/internal/utils.js.map +1 -1
  107. package/dist/module/utils/push/ios.js.map +1 -1
  108. package/dist/module/utils/push/libs/callingx.js +67 -0
  109. package/dist/module/utils/push/libs/callingx.js.map +1 -0
  110. package/dist/module/utils/push/libs/index.js +1 -2
  111. package/dist/module/utils/push/libs/index.js.map +1 -1
  112. package/dist/module/utils/push/libs/notifee/index.js +0 -18
  113. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  114. package/dist/module/utils/push/setupCallingExpEvents.js +99 -0
  115. package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -0
  116. package/dist/module/utils/push/setupIosVoipPushEvents.js +7 -6
  117. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  118. package/dist/module/version.js +1 -1
  119. package/dist/module/version.js.map +1 -1
  120. package/dist/typescript/components/Call/CallControls/ScreenShareToggleButton.d.ts +6 -1
  121. package/dist/typescript/components/Call/CallControls/ScreenShareToggleButton.d.ts.map +1 -1
  122. package/dist/typescript/hooks/index.d.ts +1 -0
  123. package/dist/typescript/hooks/index.d.ts.map +1 -1
  124. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  125. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +5 -0
  126. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -0
  127. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  128. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  129. package/dist/typescript/hooks/useScreenShareAudioMixing.d.ts +14 -0
  130. package/dist/typescript/hooks/useScreenShareAudioMixing.d.ts.map +1 -0
  131. package/dist/typescript/hooks/useScreenShareButton.d.ts +39 -2
  132. package/dist/typescript/hooks/useScreenShareButton.d.ts.map +1 -1
  133. package/dist/typescript/index.d.ts +1 -0
  134. package/dist/typescript/index.d.ts.map +1 -1
  135. package/dist/typescript/modules/ScreenShareAudioManager.d.ts +28 -0
  136. package/dist/typescript/modules/ScreenShareAudioManager.d.ts.map +1 -0
  137. package/dist/typescript/modules/call-manager/CallManager.d.ts +5 -0
  138. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  139. package/dist/typescript/providers/StreamCall/index.d.ts.map +1 -1
  140. package/dist/typescript/utils/StreamVideoRN/index.d.ts +22 -2
  141. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  142. package/dist/typescript/utils/StreamVideoRN/types.d.ts +59 -25
  143. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  144. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +16 -0
  145. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +1 -0
  146. package/dist/typescript/utils/internal/callingx/callingx.d.ts +18 -0
  147. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -0
  148. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  149. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +10 -0
  150. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +1 -0
  151. package/dist/typescript/utils/push/android.d.ts +1 -2
  152. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  153. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  154. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +0 -33
  155. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  156. package/dist/typescript/utils/push/internal/utils.d.ts +14 -8
  157. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  158. package/dist/typescript/utils/push/ios.d.ts +1 -2
  159. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  160. package/dist/typescript/utils/push/libs/callingx.d.ts +9 -0
  161. package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -0
  162. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +16 -2
  163. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  164. package/dist/typescript/utils/push/libs/index.d.ts +1 -2
  165. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  166. package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -1
  167. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  168. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +8 -0
  169. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -0
  170. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  171. package/dist/typescript/version.d.ts +1 -1
  172. package/dist/typescript/version.d.ts.map +1 -1
  173. package/expo-config-plugin/dist/withAndroidManifest.js +1 -33
  174. package/expo-config-plugin/dist/withAndroidPermissions.js +2 -7
  175. package/expo-config-plugin/dist/withAppDelegate.js +19 -197
  176. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  177. package/expo-config-plugin/dist/withiOSInfoPlist.js +2 -3
  178. package/ios/StreamInCallManager.m +2 -0
  179. package/ios/StreamInCallManager.swift +19 -7
  180. package/ios/StreamVideoReactNative.h +7 -4
  181. package/ios/StreamVideoReactNative.m +282 -86
  182. package/package.json +13 -18
  183. package/src/components/Call/CallControls/ScreenShareToggleButton.tsx +11 -1
  184. package/src/hooks/index.ts +1 -0
  185. package/src/hooks/push/index.ts +0 -2
  186. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +189 -0
  187. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +21 -34
  188. package/src/hooks/useAndroidKeepCallAliveEffect.ts +94 -120
  189. package/src/hooks/useScreenShareAudioMixing.ts +130 -0
  190. package/src/hooks/useScreenShareButton.ts +87 -2
  191. package/src/index.ts +1 -0
  192. package/src/modules/ScreenShareAudioManager.ts +49 -0
  193. package/src/modules/call-manager/CallManager.ts +36 -0
  194. package/src/modules/call-manager/native-module.d.ts +7 -0
  195. package/src/providers/StreamCall/index.tsx +17 -6
  196. package/src/utils/StreamVideoRN/index.ts +42 -30
  197. package/src/utils/StreamVideoRN/types.ts +61 -25
  198. package/src/utils/internal/callingx/audioSessionPromise.ts +65 -0
  199. package/src/utils/internal/callingx/callingx.ts +194 -0
  200. package/src/utils/internal/registerSDKGlobals.ts +52 -4
  201. package/src/utils/keepCallAliveHeadlessTask.ts +54 -0
  202. package/src/utils/push/android.ts +198 -311
  203. package/src/utils/push/internal/ios.ts +28 -44
  204. package/src/utils/push/internal/rxSubjects.ts +0 -61
  205. package/src/utils/push/internal/utils.ts +108 -64
  206. package/src/utils/push/ios.ts +1 -6
  207. package/src/utils/push/libs/callingx.ts +89 -0
  208. package/src/utils/push/libs/index.ts +1 -2
  209. package/src/utils/push/libs/notifee/index.ts +0 -27
  210. package/src/utils/push/setupCallingExpEvents.ts +135 -0
  211. package/src/utils/push/setupIosVoipPushEvents.ts +11 -7
  212. package/src/version.ts +1 -1
  213. package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +0 -95
  214. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -160
  215. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
  216. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +0 -67
  217. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +0 -1
  218. package/dist/commonjs/utils/push/libs/callkeep.js +0 -17
  219. package/dist/commonjs/utils/push/libs/callkeep.js.map +0 -1
  220. package/dist/commonjs/utils/push/libs/voipPushNotification.js +0 -17
  221. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +0 -1
  222. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +0 -205
  223. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +0 -1
  224. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -153
  225. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
  226. package/dist/module/hooks/push/useProcessPushCallEffect.js +0 -60
  227. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +0 -1
  228. package/dist/module/utils/push/libs/callkeep.js +0 -11
  229. package/dist/module/utils/push/libs/callkeep.js.map +0 -1
  230. package/dist/module/utils/push/libs/voipPushNotification.js +0 -11
  231. package/dist/module/utils/push/libs/voipPushNotification.js.map +0 -1
  232. package/dist/module/utils/push/setupIosCallKeepEvents.js +0 -199
  233. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +0 -1
  234. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +0 -5
  235. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +0 -1
  236. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +0 -8
  237. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +0 -1
  238. package/dist/typescript/utils/push/libs/callkeep.d.ts +0 -3
  239. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +0 -1
  240. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +0 -3
  241. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +0 -1
  242. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +0 -6
  243. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +0 -1
  244. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +0 -235
  245. package/src/hooks/push/useProcessPushCallEffect.ts +0 -108
  246. package/src/utils/push/libs/callkeep.ts +0 -16
  247. package/src/utils/push/libs/voipPushNotification.ts +0 -17
  248. package/src/utils/push/setupIosCallKeepEvents.ts +0 -252
@@ -4,48 +4,4 @@ import { BehaviorSubject } from 'rxjs';
4
4
  * Note: it is should be subscribed only when a user has connected to the websocket of Stream
5
5
  */
6
6
  export const pushNonRingingCallData$ = new BehaviorSubject(undefined);
7
-
8
- /**
9
- * This rxjs subject is used to store the call cid of the accepted incoming call from push notification
10
- * Note: it is should be subscribed only when a user has connected to the websocket of Stream
11
- */
12
- export const pushAcceptedIncomingCallCId$ = new BehaviorSubject(undefined);
13
-
14
- /**
15
- * This rxjs subject is used to store the call cid of the tapped incoming call from push notification it is neither accepted nor rejected yet
16
- * Note: it should be subscribed only when a user has connected to the websocket of Stream
17
- */
18
- export const pushTappedIncomingCallCId$ = new BehaviorSubject(undefined);
19
-
20
- /**
21
- * This rxjs subject is used to store the call cid of the delivered incoming call from push notification it is neither accepted nor rejected yet
22
- * Used so that the call is navigated to when app is open from being killed
23
- * Note: it should be subscribed only when a user has connected to the websocket of Stream
24
- */
25
- export const pushAndroidBackgroundDeliveredIncomingCallCId$ = new BehaviorSubject(undefined);
26
-
27
- /**
28
- * This rxjs subject is used to store the call cid of the accepted incoming call from push notification
29
- * Note: it should be subscribed only when a user has connected to the websocket of Stream
30
- */
31
- export const pushRejectedIncomingCallCId$ = new BehaviorSubject(undefined);
32
-
33
- /**
34
- * This rxjs subject is used to store the call cid of the incoming call from ios voip pushkit notification
35
- */
36
- export const voipPushNotificationCallCId$ = new BehaviorSubject(undefined);
37
-
38
- /** The pair of cid of a call and its corresponding uuid created in the native side */
39
-
40
- /*
41
- * This rxjs subject should only used to store the CallkeepMap
42
- * for the incoming call when on foreground
43
- * or in other words, when we get didDisplayIncomingCall from callkeep lib
44
- */
45
- export const voipCallkeepCallOnForegroundMap$ = new BehaviorSubject(undefined);
46
-
47
- /*
48
- * This rxjs subject should only used to store the CallkeepMap when it was accepted in the native dialer
49
- */
50
- export const voipCallkeepAcceptedCallOnNativeDialerMap$ = new BehaviorSubject(undefined);
51
7
  //# sourceMappingURL=rxSubjects.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined","pushAcceptedIncomingCallCId$","pushTappedIncomingCallCId$","pushAndroidBackgroundDeliveredIncomingCallCId$","pushRejectedIncomingCallCId$","voipPushNotificationCallCId$","voipCallkeepCallOnForegroundMap$","voipCallkeepAcceptedCallOnNativeDialerMap$"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,MAAM;AAGtC;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAID,eAAe,CAExDE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAG,IAAIH,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAME,0BAA0B,GAAG,IAAIJ,eAAe,CAE3DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,8CAA8C,GACzD,IAAIL,eAAe,CAAqBE,SAAS,CAAC;;AAEpD;AACA;AACA;AACA;AACA,OAAO,MAAMI,4BAA4B,GAAG,IAAIN,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA,OAAO,MAAMK,4BAA4B,GAAG,IAAIP,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;;AAMA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,gCAAgC,GAAG,IAAIR,eAAe,CAEjEE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA,OAAO,MAAMO,0CAA0C,GAAG,IAAIT,eAAe,CAE3EE,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,MAAM;AAGtC;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAID,eAAe,CAExDE,SAAS,CAAC","ignoreList":[]}
@@ -1,47 +1,44 @@
1
1
  import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
2
2
  import { onNewCallNotification } from '../../internal/newNotificationCallbacks';
3
3
  import { pushUnsubscriptionCallbacks } from './constants';
4
+ import { AppState } from 'react-native';
5
+ const logger = videoLoggerSystem.getLogger('callingx');
4
6
  /**
5
7
  * This function is used to check if the call should be ended based on the push notification
6
8
  * Useful for callkeep management to end the call if necessary (with reportEndCallWithUUID)
7
9
  */
8
10
  export const shouldCallBeEnded = (callFromPush, created_by_id, receiver_id) => {
9
- /* callkeep reasons for ending a call
10
- FAILED: 1,
11
- REMOTE_ENDED: 2,
12
- UNANSWERED: 3,
13
- ANSWERED_ELSEWHERE: 4,
14
- DECLINED_ELSEWHERE: 5,
15
- MISSED: 6
16
- */
17
11
  const callSession = callFromPush.state.session;
18
12
  const rejected_by = callSession?.rejected_by;
19
13
  const accepted_by = callSession?.accepted_by;
20
14
  let mustEndCall = false;
21
- let callkeepReason = 0;
22
- if (created_by_id && rejected_by) {
15
+ let endCallReason = 'unknown';
16
+ if (callFromPush.state.endedAt) {
17
+ mustEndCall = true;
18
+ endCallReason = 'remote';
19
+ } else if (created_by_id && rejected_by) {
23
20
  if (rejected_by[created_by_id]) {
24
- // call was cancelled by the caller
21
+ // call was cancelled by the caller before the receiver could answer
25
22
  mustEndCall = true;
26
- callkeepReason = 2;
23
+ endCallReason = 'canceled';
27
24
  }
28
25
  } else if (receiver_id && rejected_by) {
29
26
  if (rejected_by[receiver_id]) {
30
27
  // call was rejected by the receiver in some other device
31
28
  mustEndCall = true;
32
- callkeepReason = 5;
29
+ endCallReason = 'rejected';
33
30
  }
34
31
  } else if (receiver_id && accepted_by) {
35
32
  if (accepted_by[receiver_id]) {
36
33
  // call was accepted by the receiver in some other device
37
34
  mustEndCall = true;
38
- callkeepReason = 4;
35
+ endCallReason = 'answeredElsewhere';
39
36
  }
40
37
  }
41
- videoLoggerSystem.getLogger('shouldCallBeEnded').debug(`callCid: ${callFromPush.cid} mustEndCall: ${mustEndCall} callkeepReason: ${callkeepReason}`);
38
+ videoLoggerSystem.getLogger('shouldCallBeEnded').debug(`callCid: ${callFromPush.cid} mustEndCall: ${mustEndCall} endCallReason: ${endCallReason}`);
42
39
  return {
43
40
  mustEndCall,
44
- callkeepReason
41
+ endCallReason
45
42
  };
46
43
  };
47
44
 
@@ -49,56 +46,63 @@ export const shouldCallBeEnded = (callFromPush, created_by_id, receiver_id) => {
49
46
  1. we need to create a new client and connect the user to decline the call
50
47
  2. this is because the app is in background state and we don't have a client to get the call and do an action
51
48
  */
52
- export const processCallFromPushInBackground = async (pushConfig, call_cid, action) => {
49
+ export const processCallFromPushInBackground = async (pushConfig, call_cid, action, onIOSActionCanBeFulfilled) => {
53
50
  let videoClient;
54
51
  try {
55
52
  videoClient = await pushConfig.createStreamVideoClient();
56
53
  if (!videoClient) {
57
- return;
54
+ throw new Error('createStreamVideoClient returned null');
58
55
  }
59
56
  } catch (e) {
60
- const logger = videoLoggerSystem.getLogger('processCallFromPushInBackground');
61
- logger.error('failed to create video client', e);
57
+ logger.error('processCallFromPushInBackground: failed to create video client', e);
58
+ onIOSActionCanBeFulfilled(true);
62
59
  return;
63
60
  }
64
- await processCallFromPush(videoClient, call_cid, action, pushConfig);
65
- };
66
-
67
- /**
68
- * This function is used process the call from push notifications due to incoming call
69
- * It does the following steps:
70
- * 1. Get the call from the client if present or create a new call
71
- * 2. Fetch the latest state of the call from the server if its not already in ringing state
72
- * 3. Join or leave the call based on the user's action.
73
- */
74
- export const processCallFromPush = async (client, call_cid, action, pushConfig) => {
75
61
  let callFromPush;
76
62
  try {
77
- callFromPush = await client.onRingingCall(call_cid);
63
+ callFromPush = await videoClient.onRingingCall(call_cid);
78
64
  } catch (e) {
79
- const logger = videoLoggerSystem.getLogger('processCallFromPush');
80
- logger.error('failed to fetch call from push notification', e);
65
+ logger.error('processCallFromPushInBackground: failed to fetch call from push notification', e);
66
+ onIOSActionCanBeFulfilled(true);
81
67
  return;
82
68
  }
83
- // note: when action was pressed or delivered, we dont need to do anything as the only thing is to do is to get the call which adds it to the client
84
- try {
85
- if (action === 'accept') {
86
- if (pushConfig.publishOptions) {
87
- callFromPush.updatePublishOptions(pushConfig.publishOptions);
88
- }
89
- videoLoggerSystem.getLogger('processCallFromPush').debug(`joining call from push notification with callCid: ${callFromPush.cid}`);
69
+ if (action === 'accept') {
70
+ if (pushConfig.publishOptions) {
71
+ callFromPush.updatePublishOptions(pushConfig.publishOptions);
72
+ }
73
+ logger.debug(`joining call from push notification with callCid: ${callFromPush.cid}`);
74
+ const callingState = callFromPush.state.callingState;
75
+ if (callingState !== CallingState.RINGING && callingState !== CallingState.IDLE) {
76
+ logger.debug(`skipping join call as it is not in ringing or idle state from push notification. callCid: ${callFromPush.cid}`);
77
+ onIOSActionCanBeFulfilled(true);
78
+ return;
79
+ }
80
+ try {
81
+ onIOSActionCanBeFulfilled(false);
90
82
  await callFromPush.join();
91
- } else if (action === 'decline') {
92
- const canReject = callFromPush.state.callingState === CallingState.RINGING;
93
- videoLoggerSystem.getLogger('processCallFromPush').debug(`declining call from push notification with callCid: ${callFromPush.cid} reject: ${canReject}`);
83
+ } catch (e) {
84
+ logger.warn('processCallFromPushInBackground: failed to join call from push notification', e);
85
+ }
86
+ } else if (action === 'decline') {
87
+ const alreadyLeft = callFromPush.state.callingState === CallingState.LEFT;
88
+ if (alreadyLeft) {
89
+ onIOSActionCanBeFulfilled(false);
90
+ return;
91
+ }
92
+ const canReject = callFromPush.state.callingState === CallingState.RINGING || callFromPush.state.callingState === CallingState.IDLE;
93
+ const isCurrentUserMember = callFromPush.state.members.some(member => member.user_id === callFromPush.currentUserId);
94
+ const reject = canReject && isCurrentUserMember;
95
+ logger.debug(`declining call from push notification with callCid: ${callFromPush.cid} reject: ${reject}`);
96
+ try {
94
97
  await callFromPush.leave({
95
- reject: canReject,
98
+ reject,
96
99
  reason: 'decline'
97
100
  });
101
+ onIOSActionCanBeFulfilled(false);
102
+ } catch (e) {
103
+ logger.warn('processCallFromPushInBackground: failed to decline call from push notification', e);
104
+ onIOSActionCanBeFulfilled(true);
98
105
  }
99
- } catch (e) {
100
- const logger = videoLoggerSystem.getLogger('processCallFromPush');
101
- logger.warn(`failed to process ${action} call from push notification`, e);
102
106
  }
103
107
  };
104
108
 
@@ -122,8 +126,8 @@ export const processNonIncomingCallFromPush = async (client, call_cid, nonRingin
122
126
  await callFromPush.get();
123
127
  }
124
128
  } catch (e) {
125
- const logger = videoLoggerSystem.getLogger('processNonIncomingCallFromPush');
126
- logger.error('failed to fetch call from push notification', e);
129
+ const nonRingingCallLogger = videoLoggerSystem.getLogger('processNonIncomingCallFromPush');
130
+ nonRingingCallLogger.error('failed to fetch call from push notification', e);
127
131
  return;
128
132
  }
129
133
  onNewCallNotification(callFromPush, nonRingingNotificationType);
@@ -148,4 +152,17 @@ export const clearPushWSEventSubscriptions = call_cid => {
148
152
  export const canAddPushWSSubscriptionsRef = {
149
153
  current: true
150
154
  };
155
+ export const canListenToWS = () => canAddPushWSSubscriptionsRef.current && AppState.currentState !== 'active';
156
+ export const shouldCallBeClosed = (call, pushData) => {
157
+ const created_by_id = pushData?.created_by_id;
158
+ const receiver_id = pushData?.receiver_id;
159
+ const {
160
+ mustEndCall,
161
+ endCallReason
162
+ } = shouldCallBeEnded(call, created_by_id, receiver_id);
163
+ return {
164
+ mustEndCall,
165
+ endCallReason
166
+ };
167
+ };
151
168
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CallingState","videoLoggerSystem","onNewCallNotification","pushUnsubscriptionCallbacks","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","callkeepReason","getLogger","debug","cid","processCallFromPushInBackground","pushConfig","call_cid","action","videoClient","createStreamVideoClient","e","logger","error","processCallFromPush","client","onRingingCall","publishOptions","updatePublishOptions","join","canReject","callingState","RINGING","leave","reject","reason","warn","processNonIncomingCallFromPush","nonRingingNotificationType","_callFromPush","calls","find","c","callType","callId","split","call","get","clearPushWSEventSubscriptions","unsubscriptionCallbacks","forEach","cb","delete","canAddPushWSSubscriptionsRef","current"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":"AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAKhC,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,2BAA2B,QAAQ,aAAa;AAMzD;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,YAAkB,EAClBC,aAAiC,EACjCC,WAA+B,KAC5B;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,WAAW,GAAGH,YAAY,CAACI,KAAK,CAACC,OAAO;EAC9C,MAAMC,WAAW,GAAGH,WAAW,EAAEG,WAAW;EAC5C,MAAMC,WAAW,GAAGJ,WAAW,EAAEI,WAAW;EAC5C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,cAAc,GAAG,CAAC;EACtB,IAAIR,aAAa,IAAIK,WAAW,EAAE;IAChC,IAAIA,WAAW,CAACL,aAAa,CAAC,EAAE;MAC9B;MAC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,EAChBqB,0BAA+C,KAC5C;EACH,IAAIpC,YAAkB;EACtB,IAAI;IACF,MAAMqC,aAAa,GAAGd,MAAM,CAACnB,KAAK,CAACkC,KAAK,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAAC5B,GAAG,KAAKG,QAAQ,CAAC;IACxE,IAAIsB,aAAa,EAAE;MACjBrC,YAAY,GAAGqC,aAAa;IAC9B,CAAC,MAAM;MACL;MACA,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC,GAAG3B,QAAQ,CAAC4B,KAAK,CAAC,GAAG,CAAC;MAC9C3C,YAAY,GAAGuB,MAAM,CAACqB,IAAI,CAACH,QAAQ,EAAYC,MAAgB,CAAC;MAChE,MAAM1C,YAAY,CAAC6C,GAAG,CAAC,CAAC;IAC1B;EACF,CAAC,CAAC,OAAO1B,CAAC,EAAE;IACV,MAAMC,MAAM,GAAGxB,iBAAiB,CAACc,SAAS,CACxC,gCACF,CAAC;IACDU,MAAM,CAACC,KAAK,CAAC,6CAA6C,EAAEF,CAAC,CAAC;IAC9D;EACF;EACAtB,qBAAqB,CAACG,YAAY,EAAEoC,0BAA0B,CAAC;AACjE,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMU,6BAA6B,GAAI/B,QAAgB,IAAK;EACjE,MAAMgC,uBAAuB,GAAGjD,2BAA2B,CAAC+C,GAAG,CAAC9B,QAAQ,CAAC;EACzE,IAAIgC,uBAAuB,EAAE;IAC3BA,uBAAuB,CAACC,OAAO,CAAEC,EAAE,IAAKA,EAAE,CAAC,CAAC,CAAC;IAC7CnD,2BAA2B,CAACoD,MAAM,CAACnC,QAAQ,CAAC;EAC9C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMoC,4BAA0D,GAAG;EACxEC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CallingState","videoLoggerSystem","onNewCallNotification","pushUnsubscriptionCallbacks","AppState","logger","getLogger","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","endCallReason","endedAt","debug","cid","processCallFromPushInBackground","pushConfig","call_cid","action","onIOSActionCanBeFulfilled","videoClient","createStreamVideoClient","Error","e","error","onRingingCall","publishOptions","updatePublishOptions","callingState","RINGING","IDLE","join","warn","alreadyLeft","LEFT","canReject","isCurrentUserMember","members","some","member","user_id","currentUserId","reject","leave","reason","processNonIncomingCallFromPush","client","nonRingingNotificationType","_callFromPush","calls","find","c","callType","callId","split","call","get","nonRingingCallLogger","clearPushWSEventSubscriptions","unsubscriptionCallbacks","forEach","cb","delete","canAddPushWSSubscriptionsRef","current","canListenToWS","currentState","shouldCallBeClosed","pushData"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":"AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAKhC,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,2BAA2B,QAAQ,aAAa;AACzD,SAASC,QAAQ,QAAQ,cAAc;AAKvC,MAAMC,MAAM,GAAGJ,iBAAiB,CAACK,SAAS,CAAC,UAAU,CAAC;AAGtD;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,YAAkB,EAClBC,aAAiC,EACjCC,WAA+B,KAC5B;EACH,MAAMC,WAAW,GAAGH,YAAY,CAACI,KAAK,CAACC,OAAO;EAC9C,MAAMC,WAAW,GAAGH,WAAW,EAAEG,WAAW;EAC5C,MAAMC,WAAW,GAAGJ,WAAW,EAAEI,WAAW;EAC5C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,aAA4B,GAAG,SAAS;EAE5C,IAAIT,YAAY,CAACI,KAAK,CAACM,OAAO,EAAE;IAC9BF,WAAW,GAAG,IAAI;IAClBC,aAAa,GAAG,QAAQ;EAC1B,CAAC,MAAM,IAAIR,aAAa,IAAIK,WAAW,EAAE;IACvC,IAAIA,WAAW,CAACL,aAAa,CAAC,EAAE;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;AACA;AACA;AACA,OAAO,MAAMW,6BAA6B,GAAIzC,QAAgB,IAAK;EACjE,MAAM0C,uBAAuB,GAAG9D,2BAA2B,CAAC2D,GAAG,CAACvC,QAAQ,CAAC;EACzE,IAAI0C,uBAAuB,EAAE;IAC3BA,uBAAuB,CAACC,OAAO,CAAEC,EAAE,IAAKA,EAAE,CAAC,CAAC,CAAC;IAC7ChE,2BAA2B,CAACiE,MAAM,CAAC7C,QAAQ,CAAC;EAC9C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAM8C,4BAA0D,GAAG;EACxEC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAC3BF,4BAA4B,CAACC,OAAO,IAAIlE,QAAQ,CAACoE,YAAY,KAAK,QAAQ;AAE5E,OAAO,MAAMC,kBAAkB,GAAGA,CAChCZ,IAAU,EACVa,QAA4C,KACzC;EACH,MAAMjE,aAAa,GAAGiE,QAAQ,EAAEjE,aAAuB;EACvD,MAAMC,WAAW,GAAGgE,QAAQ,EAAEhE,WAAqB;EAEnD,MAAM;IAAEM,WAAW;IAAEC;EAAc,CAAC,GAAGV,iBAAiB,CACtDsD,IAAI,EACJpD,aAAa,EACbC,WACF,CAAC;EACD,OAAO;IAAEM,WAAW;IAAEC;EAAc,CAAC;AACvC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","pushNonRingingCallData$","getExpoNotificationsLib","getNotifeeLibThrowIfNotInstalledForPush","getPushNotificationIosLib","videoLoggerSystem","setPushLogoutCallback","StreamVideoRN","lastApnToken","token","userId","processNonRingingNotificationStreamPayload","streamPayload","sender","type","cid","call_cid","logger","getLogger","trace","next","undefined","oniOSExpoNotificationEvent","event","pushConfig","getConfig","push","trigger","request","payload","stream","JSON","stringify","oniOSNotifeeEvent","OS","detail","notifeeLib","EventType","PRESS","notification","data","result","debug","onTapNonRingingCallNotification","onPushNotificationiOSStreamVideoEvent","pushNotificationIosLib","getData","isClicked","userInteraction","finish","FetchResult","NoData","initIosNonVoipToken","client","setUnsubscribeListener","ios","pushProviderName","setDeviceToken","streamClient","_user","id","removeDevice","err","warn","push_provider_name","addDevice","then","catch","isExpo","expoNotificationsLib","getDevicePushTokenAsync","devicePushToken","subscription","addPushTokenListener","remove","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["utils/push/ios.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAEEC,uBAAuB,EACvBC,uCAAuC,EACvCC,yBAAyB,QAEpB,QAAQ;AACf,SAA4BC,iBAAiB,QAAQ,yBAAyB;AAC9E,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,aAAa,QAAQ,kBAAkB;AAKhD,IAAIC,YAAY,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC;AAE5C,SAASC,0CAA0CA,CACjDC,aAAgC,EAChC;EACA,IACEA,aAAa,EAAEC,MAAM,KAAK,cAAc,IACxCD,aAAa,EAAEE,IAAI,KAAK,WAAW,EACnC;IACA,MAAMC,GAAG,GAAGH,aAAa,CAACI,QAAQ;IAClC,MAAMF,IAAI,GAAGF,aAAa,CAACE,IAAI;IAC/B,MAAMG,MAAM,GAAGZ,iBAAiB,CAACa,SAAS,CACxC,4CACF,CAAC;IACDD,MAAM,CAACE,KAAK,CAAC,eAAeJ,GAAG,KAAKD,IAAI,EAAE,CAAC;IAC3Cb,uBAAuB,CAACmB,IAAI,CAAC;MAAEL,GAAG;MAAED;IAAK,CAAC,CAAC;IAC3C,OAAO;MAAEC,GAAG;MAAED;IAAK,CAAC;EACtB;EACA,OAAOO,SAAS;AAClB;AAEA,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAK;EACrE,MAAMC,UAAU,GAAGjB,aAAa,CAACkB,SAAS,CAAC,CAAC,CAACC,IAAI;EACjD,IAAIF,UAAU,EAAE;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CAAC8C,IAAI,CAAC,mCAAmC,EAAED,GAAG,CAAC;IACvD,CAAC,CAAC;EACN,CAAC;EACD,IAAItC,UAAU,CAAC4C,MAAM,EAAE;IACrB,MAAMC,oBAAoB,GAAGnE,uBAAuB,CAAC,CAAC;IACtD,IAAImE,oBAAoB,EAAE;MACxBA,oBAAoB,CAACC,uBAAuB,CAAC,CAAC,CAACJ,IAAI,CAAEK,eAAe,IAAK;QACvEtD,MAAM,CAACyB,KAAK,CACV,iEAAiE,EACjE6B,eAAe,CAAC/B,IAClB,CAAC;QACDiB,cAAc,CAACc,eAAe,CAAC/B,IAAI,CAAC;MACtC,CAAC,CAAC;MACF,MAAMgC,YAAY,GAAGH,oBAAoB,CAACI,oBAAoB,CAC3DF,eAAe,IAAK;QACnBtD,MAAM,CAACyB,KAAK,CACV,8DAA8D,EAC9D6B,eAAe,CAAC/B,IAClB,CAAC;QACDiB,cAAc,CAACc,eAAe,CAAC/B,IAAI,CAAC;MACtC,CACF,CAAC;MACDc,sBAAsB,CAAC,MAAM;QAC3BrC,MAAM,CAACyB,KAAK,CAAC,mCAAmC,CAAC;QACjD8B,YAAY,CAACE,MAAM,CAAC,CAAC;MACvB,CAAC,CAAC;IACJ;EACF,CAAC,MAAM;IACL,MAAM7B,sBAAsB,GAAGzC,yBAAyB,CAAC,CAAC;IAC1DyC,sBAAsB,CAAC8B,gBAAgB,CAAC,UAAU,EAAGlE,KAAK,IAAK;MAC7DQ,MAAM,CAACyB,KAAK,CACV,wEAAwE,EACxEjC,KACF,CAAC;MACDgD,cAAc,CAAChD,KAAK,CAAC;IACvB,CAAC,CAAC;IACF6C,sBAAsB,CAAC,MAAM;MAC3BrC,MAAM,CAACyB,KAAK,CAAC,wDAAwD,CAAC;MACtEG,sBAAsB,CAAC+B,mBAAmB,CAAC,UAAU,CAAC;IACxD,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["Platform","pushNonRingingCallData$","getExpoNotificationsLib","getNotifeeLibThrowIfNotInstalledForPush","getPushNotificationIosLib","videoLoggerSystem","setPushLogoutCallback","StreamVideoRN","lastApnToken","token","userId","processNonRingingNotificationStreamPayload","streamPayload","sender","type","cid","call_cid","logger","getLogger","trace","next","undefined","oniOSExpoNotificationEvent","event","pushConfig","getConfig","push","trigger","request","payload","stream","JSON","stringify","oniOSNotifeeEvent","OS","detail","notifeeLib","EventType","PRESS","notification","data","result","debug","onTapNonRingingCallNotification","onPushNotificationiOSStreamVideoEvent","pushNotificationIosLib","getData","isClicked","userInteraction","finish","FetchResult","NoData","initIosNonVoipToken","client","setUnsubscribeListener","ios","pushProviderName","setDeviceToken","streamClient","_user","id","removeDevice","err","warn","push_provider_name","addDevice","then","catch","isExpo","expoNotificationsLib","getDevicePushTokenAsync","devicePushToken","subscription","addPushTokenListener","remove","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["utils/push/ios.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAEEC,uBAAuB,EACvBC,uCAAuC,EACvCC,yBAAyB,QAEpB,QAAQ;AACf,SAA4BC,iBAAiB,QAAQ,yBAAyB;AAC9E,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,aAAa,QAAQ,kBAAkB;AAKhD,IAAIC,YAAY,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC;AAE5C,SAASC,0CAA0CA,CACjDC,aAAgC,EAChC;EACA,IACEA,aAAa,EAAEC,MAAM,KAAK,cAAc,IACxCD,aAAa,EAAEE,IAAI,KAAK,WAAW,EACnC;IACA,MAAMC,GAAG,GAAGH,aAAa,CAACI,QAAQ;IAClC,MAAMF,IAAI,GAAGF,aAAa,CAACE,IAAI;IAC/B,MAAMG,MAAM,GAAGZ,iBAAiB,CAACa,SAAS,CACxC,4CACF,CAAC;IACDD,MAAM,CAACE,KAAK,CAAC,eAAeJ,GAAG,KAAKD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CACV,wEAAwE,EACxEjC,KACF,CAAC;MACDgD,cAAc,CAAChD,KAAK,CAAC;IACvB,CAAC,CAAC;IACF6C,sBAAsB,CAAC,MAAM;MAC3BrC,MAAM,CAACyB,KAAK,CAAC,wDAAwD,CAAC;MACtEG,sBAAsB,CAAC+B,mBAAmB,CAAC,UAAU,CAAC;IACxD,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ let callingx;
2
+ try {
3
+ callingx = require('@stream-io/react-native-callingx').CallingxModule;
4
+ } catch {}
5
+ export function getCallingxLib() {
6
+ if (!callingx) {
7
+ throw Error('react-native-callingx library is not installed.');
8
+ }
9
+ return callingx;
10
+ }
11
+ export function getCallingxLibIfAvailable() {
12
+ return callingx ?? undefined;
13
+ }
14
+ export function extractCallingExpOptions(config) {
15
+ const {
16
+ push: pushConfig,
17
+ foregroundService: foregroundServiceConfig
18
+ } = config;
19
+ const callingExpOptions = {};
20
+ if (pushConfig?.ios) {
21
+ const iosOptions = {};
22
+ if (pushConfig.ios.supportsVideo !== undefined) {
23
+ iosOptions.supportsVideo = pushConfig.ios.supportsVideo;
24
+ }
25
+ if (pushConfig.ios.sound !== undefined) {
26
+ iosOptions.sound = pushConfig.ios.sound;
27
+ }
28
+ if (pushConfig.ios.imageName !== undefined) {
29
+ iosOptions.imageName = pushConfig.ios.imageName;
30
+ }
31
+ if (pushConfig.ios.callsHistory !== undefined) {
32
+ iosOptions.callsHistory = pushConfig.ios.callsHistory;
33
+ }
34
+ if (pushConfig.ios.displayCallTimeout !== undefined) {
35
+ iosOptions.displayCallTimeout = pushConfig.ios.displayCallTimeout;
36
+ }
37
+ if (Object.keys(iosOptions).length > 0) {
38
+ callingExpOptions.ios = iosOptions;
39
+ }
40
+ }
41
+ const androidOptions = {};
42
+ if (pushConfig?.android) {
43
+ if (pushConfig.android.incomingChannel) {
44
+ androidOptions.incomingChannel = pushConfig.android.incomingChannel;
45
+ }
46
+ if (pushConfig.android.titleTransformer) {
47
+ androidOptions.titleTransformer = pushConfig.android.titleTransformer;
48
+ }
49
+ if (pushConfig.android.notificationTexts) {
50
+ androidOptions.notificationTexts = pushConfig.android.notificationTexts;
51
+ }
52
+ }
53
+ if (foregroundServiceConfig.android.channel) {
54
+ androidOptions.ongoingChannel = foregroundServiceConfig.android.channel;
55
+ }
56
+ if (Object.keys(androidOptions).length > 0) {
57
+ callingExpOptions.android = androidOptions;
58
+ }
59
+ if (pushConfig?.shouldRejectCallWhenBusy !== undefined) {
60
+ callingExpOptions.shouldRejectCallWhenBusy = pushConfig.shouldRejectCallWhenBusy;
61
+ }
62
+ if (pushConfig?.enableOngoingCalls !== undefined) {
63
+ callingExpOptions.enableOngoingCalls = pushConfig?.enableOngoingCalls;
64
+ }
65
+ return callingExpOptions;
66
+ }
67
+ //# sourceMappingURL=callingx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["callingx","require","CallingxModule","getCallingxLib","Error","getCallingxLibIfAvailable","undefined","extractCallingExpOptions","config","push","pushConfig","foregroundService","foregroundServiceConfig","callingExpOptions","ios","iosOptions","supportsVideo","sound","imageName","callsHistory","displayCallTimeout","Object","keys","length","androidOptions","android","incomingChannel","titleTransformer","notificationTexts","channel","ongoingChannel","shouldRejectCallWhenBusy","enableOngoingCalls"],"sourceRoot":"../../../../../src","sources":["utils/push/libs/callingx.ts"],"mappings":"AAUA,IAAIA,QAAoC;AAExC,IAAI;EACFA,QAAQ,GAAGC,OAAO,CAAC,kCAAkC,CAAC,CAACC,cAAc;AACvE,CAAC,CAAC,MAAM,CAAC;AAET,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAI,CAACH,QAAQ,EAAE;IACb,MAAMI,KAAK,CAAC,iDAAiD,CAAC;EAChE;EACA,OAAOJ,QAAQ;AACjB;AAEA,OAAO,SAASK,yBAAyBA,CAAA,EAAG;EAC1C,OAAOL,QAAQ,IAAIM,SAAS;AAC9B;AAEA,OAAO,SAASC,wBAAwBA,CACtCC,MAAyB,E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CAACE,gBAAgB,EAAE;MACvCH,cAAc,CAACG,gBAAgB,GAAGjB,UAAU,CAACe,OAAO,CAACE,gBAAgB;IACvE;IACA,IAAIjB,UAAU,CAACe,OAAO,CAACG,iBAAiB,EAAE;MACxCJ,cAAc,CAACI,iBAAiB,GAAGlB,UAAU,CAACe,OAAO,CAACG,iBAAiB;IACzE;EACF;EAEA,IAAIhB,uBAAuB,CAACa,OAAO,CAACI,OAAO,EAAE;IAC3CL,cAAc,CAACM,cAAc,GAAGlB,uBAAuB,CAACa,OAAO,CAACI,OAAO;EACzE;EAEA,IAAIR,MAAM,CAACC,IAAI,CAACE,cAAc,CAAC,CAACD,MAAM,GAAG,CAAC,EAAE;IAC1CV,iBAAiB,CAACY,OAAO,GAAGD,cAAc;EAC5C;EAEA,IAAId,UAAU,EAAEqB,wBAAwB,KAAKzB,SAAS,EAAE;IACtDO,iBAAiB,CAACkB,wBAAwB,GACxCrB,UAAU,CAACqB,wBAAwB;EACvC;EAEA,IAAIrB,UAAU,EAAEsB,kBAAkB,KAAK1B,SAAS,EAAE;IAChDO,iBAAiB,CAACmB,kBAAkB,GAAGtB,UAAU,EAAEsB,kBAAkB;EACvE;EAEA,OAAOnB,iBAAiB;AAC1B","ignoreList":[]}
@@ -1,9 +1,8 @@
1
1
  export * from './expoNotifications';
2
2
  export * from './firebaseMessaging';
3
3
  export * from './iosPushNotification';
4
- export * from './voipPushNotification';
5
- export * from './callkeep';
6
4
  export * from './notifee';
5
+ export * from './callingx';
7
6
 
8
7
  /*
9
8
  NOTE: must keep each libs in different files
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["utils/push/libs/index.ts"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,wBAAwB;AACtC,cAAc,YAAY;AAC1B,cAAc,WAAW;;AAEzB;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["utils/push/libs/index.ts"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,WAAW;AACzB,cAAc,YAAY;;AAE1B;AACA;AACA;AACA","ignoreList":[]}
@@ -1,6 +1,4 @@
1
- import { PermissionsAndroid } from 'react-native';
2
1
  import { lib } from './lib';
3
- import { videoLoggerSystem } from '@stream-io/video-client';
4
2
  var AndroidForegroundServiceType = /*#__PURE__*/function (AndroidForegroundServiceType) {
5
3
  AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CAMERA"] = 64] = "FOREGROUND_SERVICE_TYPE_CAMERA";
6
4
  AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE"] = 16] = "FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE";
@@ -27,24 +25,8 @@ export function getNotifeeLibThrowIfNotInstalledForPush() {
27
25
  return lib;
28
26
  }
29
27
  export function getNotifeeLibNoThrowForKeepCallAlive() {
30
- if (!lib) {
31
- const logger = videoLoggerSystem.getLogger('getNotifeeLibNoThrow');
32
- logger.info(`${'@notifee/react-native library not installed. It is required to keep call alive in the background for Android. '}${INSTALLATION_INSTRUCTION}`);
33
- }
34
28
  return lib;
35
29
  }
36
- export async function getKeepCallAliveForegroundServiceTypes() {
37
- const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK];
38
- const hasCameraPermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA);
39
- if (hasCameraPermission) {
40
- types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_CAMERA);
41
- }
42
- const hasMicrophonePermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
43
- if (hasMicrophonePermission) {
44
- types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_MICROPHONE);
45
- }
46
- return types;
47
- }
48
30
  export function getIncomingCallForegroundServiceTypes() {
49
31
  const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE];
50
32
  return types;
@@ -1 +1 @@
1
- {"version":3,"names":["PermissionsAndroid","lib","videoLoggerSystem","AndroidForegroundServiceType","INSTALLATION_INSTRUCTION","getNotifeeLibThrowIfNotInstalledForPush","Error","getNotifeeLibNoThrowForKeepCallAlive","logger","getLogger","info","getKeepCallAliveForegroundServiceTypes","types","FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK","hasCameraPermission","check","PERMISSIONS","CAMERA","push","FOREGROUND_SERVICE_TYPE_CAMERA","hasMicrophonePermission","RECORD_AUDIO","FOREGROUND_SERVICE_TYPE_MICROPHONE","getIncomingCallForegroundServiceTypes","FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/index.ts"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,cAAc;AACjD,SAASC,GAAG,QAAmB,OAAO;AACtC,SAASC,iBAAiB,QAAQ,yBAAyB;AAAC,IAIvDC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA,EAA5BA,4BAA4B;AAkBjC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAE/F,OAAO,SAASC,uCAAuCA,CAAA,EAAG;EACxD,IAAI,CAACJ,GAAG,EAAE;IACR,MAAMK,KAAK,CACT,8FAA8F,GAC5FF,wBACJ,CAAC;EACH;EACA,OAAOH,GAAG;AACZ;AAEA,OAAO,SAASM,oCAAoCA,CAAA,EAAG;EACrD,IAAI,CAACN,GAAG,EAAE;IACR,MAAMO,MAAM,GAAGN,iBAAiB,CAACO,SAAS,CAAC,sBAAsB,CAAC;IAClED,MAAM,CAACE,IAAI,CACT,GAAG,gHAAgH,GAAGN,wBAAwB,EAChJ,CAAC;EACH;EACA,OAAOH,GAAG;AACZ;AAEA,OAAO,eAAeU,sCAAsCA,CAAA,EAAG;EAC7D,MAAMC,KAAqC,GAAG,CAC5CT,4BAA4B,CAACU,sCAAsC,CACpE;EACD,MAAMC,mBAAmB,GAAG,MAAMd,kBAAkB,CAACe,KAAK,CACxDf,kBAAkB,CAACgB,WAAW,CAACC,MACjC,CAAC;EACD,IAAIH,mBAAmB,EAAE;IACvBF,KAAK,CAACM,IAAI,CAACf,4BAA4B,CAACgB,8BAA8B,CAAC;EACzE;EACA,MAAMC,uBAAuB,GAAG,MAAMpB,kBAAkB,CAACe,KAAK,CAC5Df,kBAAkB,CAACgB,WAAW,CAACK,YACjC,CAAC;EACD,IAAID,uBAAuB,EAAE;IAC3BR,KAAK,CAACM,IAAI,CAACf,4BAA4B,CAACmB,kCAAkC,CAAC;EAC7E;EACA,OAAOV,KAAK;AACd;AAEA,OAAO,SAASW,qCAAqCA,CAAA,EAAG;EACtD,MAAMX,KAAqC,GAAG,CAC5CT,4BAA4B,CAACqB,qCAAqC,CACnE;EACD,OAAOZ,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"names":["lib","AndroidForegroundServiceType","INSTALLATION_INSTRUCTION","getNotifeeLibThrowIfNotInstalledForPush","Error","getNotifeeLibNoThrowForKeepCallAlive","getIncomingCallForegroundServiceTypes","types","FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/index.ts"],"mappings":"AAAA,SAASA,GAAG,QAAmB,OAAO;AAAC,IAIlCC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA,EAA5BA,4BAA4B;AAkBjC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAE/F,OAAO,SAASC,uCAAuCA,CAAA,EAAG;EACxD,IAAI,CAACH,GAAG,EAAE;IACR,MAAMI,KAAK,CACT,8FAA8F,GAC5FF,wBACJ,CAAC;EACH;EACA,OAAOF,GAAG;AACZ;AAEA,OAAO,SAASK,oCAAoCA,CAAA,EAAG;EACrD,OAAOL,GAAG;AACZ;AAEA,OAAO,SAASM,qCAAqCA,CAAA,EAAG;EACtD,MAAMC,KAAqC,GAAG,CAC5CN,4BAA4B,CAACO,qCAAqC,CACnE;EACD,OAAOD,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ import { videoLoggerSystem } from '@stream-io/video-client';
2
+ import { clearPushWSEventSubscriptions, processCallFromPushInBackground } from './internal/utils';
3
+ import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
4
+ import { resolvePendingAudioSession } from '../internal/callingx/audioSessionPromise';
5
+ import { getCallingxLib } from './libs/callingx';
6
+ import { Platform } from 'react-native';
7
+ const logger = videoLoggerSystem.getLogger('callingx');
8
+
9
+ /**
10
+ * Sets up callingx event listeners for handling call actions from the native calling UI.
11
+ */
12
+ export function setupCallingExpEvents(pushConfig) {
13
+ const hasPushProvider = Platform.OS === 'android' && pushConfig.android?.pushProviderName || Platform.OS === 'ios' && pushConfig.ios?.pushProviderName;
14
+ if (!hasPushProvider) {
15
+ return;
16
+ }
17
+ const callingx = getCallingxLib();
18
+ const {
19
+ remove: removeAnswerCall
20
+ } = callingx.addEventListener('answerCall', params => {
21
+ onAcceptCall(pushConfig)(params);
22
+ });
23
+ const {
24
+ remove: removeEndCall
25
+ } = callingx.addEventListener('endCall', params => {
26
+ onEndCall(pushConfig)(params);
27
+ });
28
+ const {
29
+ remove: removeDidActivateAudioSession
30
+ } = callingx.addEventListener('didActivateAudioSession', onDidActivateAudioSession);
31
+ const {
32
+ remove: removeDidDeactivateAudioSession
33
+ } = callingx.addEventListener('didDeactivateAudioSession', onDidDeactivateAudioSession);
34
+
35
+ //NOTE: until getInitialEvents invocation, events are delayed and won't be sent to event listeners, this is a way to make sure none of required events are missed
36
+ //in most cases there will be no delayed answers or ends, but if so we don't want to miss any of them
37
+ const events = callingx.getInitialEvents();
38
+ events.forEach(event => {
39
+ const {
40
+ eventName,
41
+ params
42
+ } = event;
43
+ if (eventName === 'answerCall') {
44
+ logger.debug(`answerCall delayed event callId: ${params?.callId}`);
45
+ onAcceptCall(pushConfig)(params);
46
+ } else if (eventName === 'endCall') {
47
+ logger.debug(`endCall delayed event callId: ${params?.callId}`);
48
+ onEndCall(pushConfig)(params);
49
+ } else if (eventName === 'didActivateAudioSession') {
50
+ onDidActivateAudioSession();
51
+ } else if (eventName === 'didDeactivateAudioSession') {
52
+ onDidDeactivateAudioSession();
53
+ }
54
+ });
55
+ setPushLogoutCallback(async () => {
56
+ removeAnswerCall();
57
+ removeEndCall();
58
+ removeDidActivateAudioSession();
59
+ removeDidDeactivateAudioSession();
60
+ });
61
+ }
62
+ const onDidActivateAudioSession = () => {
63
+ logger.debug('callingExpDidActivateAudioSession');
64
+ resolvePendingAudioSession();
65
+ };
66
+ const onDidDeactivateAudioSession = () => {
67
+ logger.debug('callingExpDidDeactivateAudioSession');
68
+ };
69
+ const onAcceptCall = pushConfig => ({
70
+ callId: call_cid,
71
+ source
72
+ }) => {
73
+ logger.debug(`onAcceptCall event call_cid: ${call_cid} source: ${source}`);
74
+ if (source === 'app' || !call_cid) {
75
+ // App-initiated actions are fulfilled on the native side immediately — nothing to do here
76
+ return;
77
+ }
78
+ const callingx = getCallingxLib();
79
+ clearPushWSEventSubscriptions(call_cid);
80
+ processCallFromPushInBackground(pushConfig, call_cid, 'accept', didFail => {
81
+ callingx.fulfillAnswerCallAction(call_cid, didFail);
82
+ });
83
+ };
84
+ const onEndCall = pushConfig => ({
85
+ callId: call_cid,
86
+ source
87
+ }) => {
88
+ logger.debug(`onEndCall event call_cid: ${call_cid} source: ${source}`);
89
+ if (source === 'app' || !call_cid) {
90
+ // App-initiated actions are fulfilled on the native side immediately — nothing to do here
91
+ return;
92
+ }
93
+ const callingx = getCallingxLib();
94
+ clearPushWSEventSubscriptions(call_cid);
95
+ processCallFromPushInBackground(pushConfig, call_cid, 'decline', didFail => {
96
+ callingx.fulfillEndCallAction(call_cid, didFail);
97
+ });
98
+ };
99
+ //# sourceMappingURL=setupCallingExpEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["videoLoggerSystem","clearPushWSEventSubscriptions","processCallFromPushInBackground","setPushLogoutCallback","resolvePendingAudioSession","getCallingxLib","Platform","logger","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","OS","android","pushProviderName","ios","callingx","remove","removeAnswerCall","addEventListener","params","onAcceptCall","removeEndCall","onEndCall","removeDidActivateAudioSession","onDidActivateAudioSession","removeDidDeactivateAudioSession","onDidDeactivateAudioSession","events","getInitialEvents","forEach","event","eventName","debug","callId","call_cid","source","didFail","fulfillAnswerCallAction","fulfillEndCallAction"],"sourceRoot":"../../../../src","sources":["utils/push/setupCallingExpEvents.ts"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAyB;AAE3D,SACEC,6BAA6B,EAC7BC,+BAA+B,QAC1B,kBAAkB;AACzB,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,0BAA0B,QAAQ,0CAA0C;AACrF,SACEC,cAAc,QAGT,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,cAAc;AAIvC,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CAAC,UAAU,CAAC;;AAEtD;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,UAAmC,EAAE;EACzE,MAAMC,eAAe,GAClBL,QAAQ,CAACM,EAAE,KAAK,SAAS,IAAIF,UAAU,CAACG,OAAO,EAAEC,gBAAgB,IACjER,QAAQ,CAACM,EAAE,KAAK,KAAK,IAAIF,UAAU,CAACK,GAAG,EAAED,gBAAiB;EAE7D,IAAI,CAACH,eAAe,EAAE;IACpB;EACF;EAEA,MAAMK,QAAQ,GAAGX,cAAc,CAAC,CAAC;EAEjC,MAAM;IAAEY,MAAM,EAAEC;EAAiB,CAAC,GAAGF,QAAQ,CAACG,gBAAgB,CAC5D,YAAY,EACXC,MAAM,IAAK;IACVC,YAAY,CAACX,UAAU,CAAC,CAACU,MAAM,CAAC;EAClC,CACF,CAAC;EAED,MAAM;IAAEH,MAAM,EAAEK;EAAc,CAAC,GAAGN,QAAQ,CAACG,gBAAgB,CACzD,SAAS,EACRC,MAAM,IAAK;IACVG,SAAS,CAACb,UAAU,CAAC,CAACU,MAAM,CAAC;EAC/B,CACF,CAAC;EAED,MAAM;IAAEH,MAAM,EAAEO;EAA8B,CAAC,GAAGR,QAAQ,CAACG,gBAAgB,C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,CAAC;AAED,MAAMZ,YAAY,GACfX,UAAsB,IACvB,CAAC;EAAEwB,MAAM,EAAEC,QAAQ;EAAEC;AAAkC,CAAC,KAAK;EAC3D7B,MAAM,CAAC0B,KAAK,CAAC,gCAAgCE,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAE1E,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEA,MAAMnB,QAAQ,GAAGX,cAAc,CAAC,CAAC;EACjCJ,6BAA6B,CAACkC,QAAQ,CAAC;EAEvCjC,+BAA+B,CAC7BQ,UAAU,EACVyB,QAAQ,EACR,QAAQ,EACPE,OAAO,IAAK;IACXrB,QAAQ,CAACsB,uBAAuB,CAACH,QAAQ,EAAEE,OAAO,CAAC;EACrD,CACF,CAAC;AACH,CAAC;AAEH,MAAMd,SAAS,GACZb,UAAsB,IACvB,CAAC;EAAEwB,MAAM,EAAEC,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EACxD7B,MAAM,CAAC0B,KAAK,CAAC,6BAA6BE,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAEvE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEA,MAAMnB,QAAQ,GAAGX,cAAc,CAAC,CAAC;EACjCJ,6BAA6B,CAACkC,QAAQ,CAAC;EACvCjC,+BAA+B,CAC7BQ,UAAU,EACVyB,QAAQ,EACR,SAAS,EACRE,OAAO,IAAK;IACXrB,QAAQ,CAACuB,oBAAoB,CAACJ,QAAQ,EAAEE,OAAO,CAAC;EAClD,CACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,8 +1,10 @@
1
- import { getVoipPushNotificationLib } from './libs';
1
+ // import { getVoipPushNotificationLib } from './libs';
2
+
2
3
  import { Platform } from 'react-native';
3
4
  import { onVoipNotificationReceived } from './internal/ios';
4
5
  import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
5
6
  import { videoLoggerSystem } from '@stream-io/video-client';
7
+ import { getCallingxLib } from './libs';
6
8
  export function setupIosVoipPushEvents(pushConfig) {
7
9
  if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
8
10
  return;
@@ -13,14 +15,13 @@ export function setupIosVoipPushEvents(pushConfig) {
13
15
  logger.debug('ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents');
14
16
  return;
15
17
  }
16
- const voipPushNotification = getVoipPushNotificationLib();
17
- logger.debug('notification event listener added');
18
- voipPushNotification.addEventListener('notification', notification => {
19
- onVoipNotificationReceived(notification, pushConfig);
18
+ const callingx = getCallingxLib();
19
+ const voipNotificationReceivedListener = callingx.addEventListener('voipNotificationReceived', params => {
20
+ onVoipNotificationReceived(params, pushConfig);
20
21
  });
21
22
  setPushLogoutCallback(async () => {
22
23
  videoLoggerSystem.getLogger('setPushLogoutCallback').debug('notification event listener removed');
23
- voipPushNotification.removeEventListener('notification');
24
+ voipNotificationReceivedListener.remove();
24
25
  });
25
26
  }
26
27
  //# sourceMappingURL=setupIosVoipPushEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getVoipPushNotificationLib","Platform","onVoipNotificationReceived","setPushLogoutCallback","videoLoggerSystem","setupIosVoipPushEvents","pushConfig","OS","ios","pushProviderName","logger","getLogger","debug","voipPushNotification","addEventListener","notification","removeEventListener"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,QAAQ;AAEnD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,IAAIL,QAAQ,CAACM,EAAE,KAAK,KAAK,IAAI,CAACD,UAAU,CAACE,GAAG,EAAEC,gBAAgB,EAAE;IAC9D;EACF;EACA,MAAMC,MAAM,GAAGN,iBAAiB,CAACO,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAI,CAACL,UAAU,CAACE,GAAG,CAACC,gBAAgB,EAAE;IACpC;IACAC,MAAM,CAACE,KAAK,CACV,6EACF,CAAC;IACD;EACF;EACA,MAAMC,oBAAoB,GAAGb,0BAA0B,CAAC,CAAC;EAEzDU,MAAM,CAACE,KAAK,CAAC,mCAAmC,CAAC;EACjDC,oBAAoB,CAACC,gBAAgB,CAAC,cAAc,EAAGC,YAAY,IAAK;IACtEb,0BAA0B,CAACa,YAAY,EAAET,UAAU,CAAC;EACtD,CAAC,CAAC;EACFH,qBAAqB,CAAC,YAAY;IAChCC,iBAAiB,CACdO,SAAS,CAAC,uBAAuB,CAAC,CAClCC,KAAK,CAAC,qCAAqC,CAAC;IAC/CC,oBAAoB,CAACG,mBAAmB,CAAC,cAAc,CAAC;EAC1D,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["Platform","onVoipNotificationReceived","setPushLogoutCallback","videoLoggerSystem","getCallingxLib","setupIosVoipPushEvents","pushConfig","OS","ios","pushProviderName","logger","getLogger","debug","callingx","voipNotificationReceivedListener","addEventListener","params","remove"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,cAAc,QAAQ,QAAQ;AAEvC,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,IAAIN,QAAQ,CAACO,EAAE,KAAK,KAAK,IAAI,CAACD,UAAU,CAACE,GAAG,EAAEC,gBAAgB,EAAE;IAC9D;EACF;EACA,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAI,CAACL,UAAU,CAACE,GAAG,CAACC,gBAAgB,EAAE;IACpC;IACAC,MAAM,CAACE,KAAK,CACV,6EACF,CAAC;IACD;EACF;EAEA,MAAMC,QAAQ,GAAGT,cAAc,CAAC,CAAC;EACjC,MAAMU,gCAAgC,GAAGD,QAAQ,CAACE,gBAAgB,CAChE,0BAA0B,EACzBC,MAAM,IAAK;IACVf,0BAA0B,CAACe,MAAM,EAAEV,UAAU,CAAC;EAChD,CACF,CAAC;EAEDJ,qBAAqB,CAAC,YAAY;IAChCC,iBAAiB,CACdQ,SAAS,CAAC,uBAAuB,CAAC,CAClCC,KAAK,CAAC,qCAAqC,CAAC;IAC/CE,gCAAgC,CAACG,MAAM,CAAC,CAAC;EAC3C,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export const version = '1.30.5';
1
+ export const version = '1.31.1-beta.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,eAAe","ignoreList":[]}