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

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 (211) hide show
  1. package/CHANGELOG.md +3133 -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/hooks/push/index.js +2 -0
  9. package/dist/commonjs/hooks/push/index.js.map +1 -1
  10. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
  11. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  12. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  13. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  14. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
  15. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
  16. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
  17. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  18. package/dist/commonjs/index.js +0 -1
  19. package/dist/commonjs/index.js.map +1 -1
  20. package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
  21. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  22. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  23. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  24. package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
  25. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  26. package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
  27. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  28. package/dist/commonjs/utils/push/android.js +202 -155
  29. package/dist/commonjs/utils/push/android.js.map +1 -1
  30. package/dist/commonjs/utils/push/internal/ios.js +34 -17
  31. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  32. package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
  33. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  34. package/dist/commonjs/utils/push/internal/utils.js +20 -32
  35. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  36. package/dist/commonjs/utils/push/ios.js.map +1 -1
  37. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  38. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  39. package/dist/commonjs/utils/push/libs/index.js +19 -8
  40. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  41. package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
  42. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  43. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  44. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  45. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
  46. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
  47. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  48. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  49. package/dist/commonjs/version.js +1 -1
  50. package/dist/commonjs/version.js.map +1 -1
  51. package/dist/module/hooks/push/index.js +2 -0
  52. package/dist/module/hooks/push/index.js.map +1 -1
  53. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
  54. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  55. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  56. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  57. package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
  58. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
  59. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
  60. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  61. package/dist/module/index.js +0 -1
  62. package/dist/module/index.js.map +1 -1
  63. package/dist/module/modules/call-manager/CallManager.js +0 -26
  64. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  65. package/dist/module/providers/StreamCall/index.js +6 -6
  66. package/dist/module/providers/StreamCall/index.js.map +1 -1
  67. package/dist/module/utils/StreamVideoRN/index.js +21 -33
  68. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  69. package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
  70. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  71. package/dist/module/utils/push/android.js +204 -157
  72. package/dist/module/utils/push/android.js.map +1 -1
  73. package/dist/module/utils/push/internal/ios.js +34 -17
  74. package/dist/module/utils/push/internal/ios.js.map +1 -1
  75. package/dist/module/utils/push/internal/rxSubjects.js +44 -0
  76. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  77. package/dist/module/utils/push/internal/utils.js +19 -29
  78. package/dist/module/utils/push/internal/utils.js.map +1 -1
  79. package/dist/module/utils/push/ios.js.map +1 -1
  80. package/dist/module/utils/push/libs/callkeep.js +11 -0
  81. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  82. package/dist/module/utils/push/libs/index.js +2 -1
  83. package/dist/module/utils/push/libs/index.js.map +1 -1
  84. package/dist/module/utils/push/libs/notifee/index.js +18 -0
  85. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  86. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  87. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  88. package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
  89. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
  90. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  91. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  92. package/dist/module/version.js +1 -1
  93. package/dist/module/version.js.map +1 -1
  94. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  95. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
  96. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
  97. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  98. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
  99. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
  100. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  101. package/dist/typescript/index.d.ts +0 -1
  102. package/dist/typescript/index.d.ts.map +1 -1
  103. package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
  104. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  105. package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
  106. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  107. package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
  108. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  109. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  110. package/dist/typescript/utils/push/android.d.ts +2 -1
  111. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  112. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  113. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
  114. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  115. package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
  116. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  117. package/dist/typescript/utils/push/ios.d.ts +2 -1
  118. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  119. package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
  120. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  121. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +2 -16
  122. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  123. package/dist/typescript/utils/push/libs/index.d.ts +2 -1
  124. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  125. package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
  126. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  127. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
  128. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  129. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
  130. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
  131. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  132. package/dist/typescript/version.d.ts +1 -1
  133. package/dist/typescript/version.d.ts.map +1 -1
  134. package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
  135. package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
  136. package/expo-config-plugin/dist/withAppDelegate.js +197 -19
  137. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  138. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
  139. package/ios/StreamInCallManager.m +0 -2
  140. package/ios/StreamInCallManager.swift +7 -19
  141. package/ios/StreamVideoReactNative.h +4 -7
  142. package/ios/StreamVideoReactNative.m +82 -189
  143. package/package.json +19 -14
  144. package/src/hooks/push/index.ts +2 -0
  145. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
  146. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
  147. package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
  148. package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
  149. package/src/index.ts +0 -1
  150. package/src/modules/call-manager/CallManager.ts +0 -36
  151. package/src/modules/call-manager/native-module.d.ts +0 -7
  152. package/src/providers/StreamCall/index.tsx +6 -6
  153. package/src/utils/StreamVideoRN/index.ts +30 -40
  154. package/src/utils/StreamVideoRN/types.ts +29 -56
  155. package/src/utils/internal/registerSDKGlobals.ts +4 -47
  156. package/src/utils/push/android.ts +309 -231
  157. package/src/utils/push/internal/ios.ts +44 -28
  158. package/src/utils/push/internal/rxSubjects.ts +61 -0
  159. package/src/utils/push/internal/utils.ts +26 -45
  160. package/src/utils/push/ios.ts +6 -1
  161. package/src/utils/push/libs/callkeep.ts +16 -0
  162. package/src/utils/push/libs/index.ts +2 -1
  163. package/src/utils/push/libs/notifee/index.ts +27 -0
  164. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  165. package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
  166. package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
  167. package/src/version.ts +1 -1
  168. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
  169. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
  170. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
  171. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  172. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
  173. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  174. package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
  175. package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
  176. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
  177. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
  178. package/dist/commonjs/utils/push/libs/callingx.js +0 -75
  179. package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
  180. package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
  181. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
  182. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
  183. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  184. package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
  185. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  186. package/dist/module/utils/internal/callingx/callingx.js +0 -100
  187. package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
  188. package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
  189. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
  190. package/dist/module/utils/push/libs/callingx.js +0 -67
  191. package/dist/module/utils/push/libs/callingx.js.map +0 -1
  192. package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
  193. package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
  194. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
  195. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
  196. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
  197. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
  198. package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -13
  199. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
  200. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
  201. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
  202. package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
  203. package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
  204. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
  205. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
  206. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
  207. package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
  208. package/src/utils/internal/callingx/callingx.ts +0 -146
  209. package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
  210. package/src/utils/push/libs/callingx.ts +0 -90
  211. package/src/utils/push/setupCallingExpEvents.ts +0 -130
@@ -0,0 +1,60 @@
1
+ import { pushAcceptedIncomingCallCId$, pushAndroidBackgroundDeliveredIncomingCallCId$, pushRejectedIncomingCallCId$, pushTappedIncomingCallCId$ } from '../../utils/push/internal/rxSubjects';
2
+ import { useEffect } from 'react';
3
+ import { StreamVideoRN } from '../../utils';
4
+ import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
5
+ import { distinctUntilChanged, filter } from 'rxjs/operators';
6
+ import { processCallFromPush } from '../../utils/push/internal/utils';
7
+ import { videoLoggerSystem } from '@stream-io/video-client';
8
+ /**
9
+ * This hook is used to process the incoming call data via push notifications using the relevant rxjs subjects
10
+ * It either joins or leaves the call based on the user's action.
11
+ * Note: this effect cannot work when push notifications are received when the app is in quit state or in other words when the client is not connected with a websocket.
12
+ * So we essentially run this effect only when the client is connected with a websocket.
13
+ */
14
+ export const useProcessPushCallEffect = () => {
15
+ const client = useStreamVideoClient();
16
+ const connectedUserId = useConnectedUser()?.id;
17
+ // The Effect to join/reject call automatically when incoming call was received and processed from push notification
18
+ useEffect(() => {
19
+ const pushConfig = StreamVideoRN.getConfig().push;
20
+ if (!pushConfig || !client || !connectedUserId) {
21
+ return;
22
+ }
23
+ videoLoggerSystem.getLogger('useProcessPushCallEffect').debug(`Adding subscriptions to process incoming call from push notification`);
24
+
25
+ // if the user accepts the call from push notification we join the call
26
+ const acceptedCallSubscription = createCallSubscription(pushAcceptedIncomingCallCId$, client, pushConfig, 'accept');
27
+
28
+ // if the user rejects the call from push notification we leave the call
29
+ const declinedCallSubscription = createCallSubscription(pushRejectedIncomingCallCId$, client, pushConfig, 'decline');
30
+
31
+ // if the user taps the call from push notification we do nothing as the only thing is to get the call which adds it to the client
32
+ const pressedCallSubscription = createCallSubscription(pushTappedIncomingCallCId$, client, pushConfig, 'pressed');
33
+ const backgroundIncomingDeliveredCallSubscription = createCallSubscription(pushAndroidBackgroundDeliveredIncomingCallCId$, client, pushConfig, 'backgroundDelivered');
34
+ return () => {
35
+ acceptedCallSubscription.unsubscribe();
36
+ declinedCallSubscription.unsubscribe();
37
+ pressedCallSubscription.unsubscribe();
38
+ backgroundIncomingDeliveredCallSubscription.unsubscribe();
39
+ };
40
+ }, [client, connectedUserId]);
41
+ };
42
+
43
+ /**
44
+ * A type guard to check if the cid is not undefined
45
+ */
46
+ function cidIsNotUndefined(cid) {
47
+ return cid !== undefined;
48
+ }
49
+
50
+ /**
51
+ * The common logic to create a subscription for the given call cid and action
52
+ */
53
+ const createCallSubscription = (behaviourSubjectWithCallCid, client, pushConfig, action) => {
54
+ return behaviourSubjectWithCallCid.pipe(distinctUntilChanged(), filter(cidIsNotUndefined)).subscribe(async callCId => {
55
+ videoLoggerSystem.getLogger('useProcessPushCallEffect').debug(`Processing call from push notification with action: ${action} and callCId: ${callCId}`);
56
+ await processCallFromPush(client, callCId, action, pushConfig);
57
+ behaviourSubjectWithCallCid.next(undefined); // remove the current call id to avoid processing again
58
+ });
59
+ };
60
+ //# sourceMappingURL=useProcessPushCallEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pushAcceptedIncomingCallCId$","pushAndroidBackgroundDeliveredIncomingCallCId$","pushRejectedIncomingCallCId$","pushTappedIncomingCallCId$","useEffect","StreamVideoRN","useConnectedUser","useStreamVideoClient","distinctUntilChanged","filter","processCallFromPush","videoLoggerSystem","useProcessPushCallEffect","client","connectedUserId","id","pushConfig","getConfig","push","getLogger","debug","acceptedCallSubscription","createCallSubscription","declinedCallSubscription","pressedCallSubscription","backgroundIncomingDeliveredCallSubscription","unsubscribe","cidIsNotUndefined","cid","undefined","behaviourSubjectWithCallCid","action","pipe","subscribe","callCId","next"],"sourceRoot":"../../../../src","sources":["hooks/push/useProcessPushCall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C,CAAC;MACtCH,wBAAwB,CAACG,WAAW,CAAC,CAAC;MACtCF,uBAAuB,CAACE,WAAW,CAAC,CAAC;MACrCD,2CAA2C,CAACC,WAAW,CAAC,CAAC;IAC3D,CAAC;EACH,CAAC,EAAE,CAACb,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA,SAASa,iBAAiBA,CAACC,GAAuB,EAAiB;EACjE,OAAOA,GAAG,KAAKC,SAAS;AAC1B;;AAEA;AACA;AACA;AACA,MAAMP,sBAAsB,GAAGA,CAC7BQ,2BAAgE,EAChEjB,MAAyB,EACzBG,UAAkD,EAClDe,MAAgE,KAC7D;EACH,OAAOD,2BAA2B,CAC/BE,IAAI,CAACxB,oBAAoB,CAAC,CAAC,EAAEC,MAAM,CAACkB,iBAAiB,CAAC,CAAC,CACvDM,SAAS,CAAC,MAAOC,OAAO,IAAK;IAC5BvB,iBAAiB,CACdQ,SAAS,CAAC,0BAA0B,CAAC,CACrCC,KAAK,CACJ,uDAAuDW,MAAM,iBAAiBG,OAAO,EACvF,CAAC;IACH,MAAMxB,mBAAmB,CAACG,MAAM,EAAEqB,OAAO,EAAEH,MAAM,EAAEf,UAAU,CAAC;IAC9Dc,2BAA2B,CAACK,IAAI,CAACN,SAAS,CAAC,CAAC,CAAC;EAC/C,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,58 +1,93 @@
1
1
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
2
2
  import { useEffect, useRef } from 'react';
3
3
  import { StreamVideoRN } from '../utils';
4
- import { AppState, NativeModules, PermissionsAndroid, Platform } from 'react-native';
4
+ import { AppState, NativeModules, Platform } from 'react-native';
5
5
  import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
6
- import { keepCallAliveCallRef } from '../utils/keepCallAliveHeadlessTask';
7
- import { getNotifeeLibNoThrowForKeepCallAlive } from '../utils/push/libs/notifee';
8
- import { getCallingxLibIfAvailable } from '../utils/push/libs';
6
+ import { getKeepCallAliveForegroundServiceTypes, getNotifeeLibNoThrowForKeepCallAlive } from '../utils/push/libs/notifee';
9
7
  const notifeeLib = getNotifeeLibNoThrowForKeepCallAlive();
10
- async function stopForegroundServiceNoThrow() {
11
- const logger = videoLoggerSystem.getLogger('stopForegroundServiceNoThrow');
12
- try {
13
- await NativeModules.StreamVideoReactNative.stopKeepCallAliveService();
14
- } catch (e) {
15
- logger.warn('Failed to stop keep-call-alive foreground service', e);
16
- }
8
+ const callToPassToForegroundService = {
9
+ current: undefined
10
+ };
11
+ function setForegroundService() {
12
+ if (Platform.OS === 'ios' || !notifeeLib) return;
13
+ NativeModules.StreamVideoReactNative.isCallAliveConfigured().then(isConfigured => {
14
+ if (!isConfigured) {
15
+ const logger = videoLoggerSystem.getLogger('setForegroundService method');
16
+ logger.info('KeepCallAlive is not configured. Skipping foreground service setup.');
17
+ return;
18
+ }
19
+ notifeeLib.default.registerForegroundService(() => {
20
+ const task = new Promise(resolve => {
21
+ const logger = videoLoggerSystem.getLogger('setForegroundService method');
22
+ logger.info('Foreground service running for call in progress');
23
+ // any task to run from SDK in the foreground service must be added
24
+ resolve(true);
25
+ });
26
+ const videoConfig = StreamVideoRN.getConfig();
27
+ const foregroundServiceConfig = videoConfig.foregroundService;
28
+ const {
29
+ taskToRun
30
+ } = foregroundServiceConfig.android;
31
+ const call = callToPassToForegroundService.current;
32
+ if (!call) {
33
+ const logger = videoLoggerSystem.getLogger('setForegroundService method');
34
+ logger.warn('No call to pass to foreground service');
35
+ return task.then(() => new Promise(() => {}));
36
+ }
37
+ callToPassToForegroundService.current = undefined;
38
+ return task.then(() => taskToRun(call));
39
+ });
40
+ });
17
41
  }
18
42
  async function startForegroundService(call_cid) {
19
- const logger = videoLoggerSystem.getLogger('startForegroundService');
20
- const isCallAliveConfigured = await (async () => {
21
- try {
22
- return await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
23
- } catch (e) {
24
- logger.warn('Failed to check whether KeepCallAlive is configured', e);
25
- return false;
26
- }
27
- })();
43
+ const isCallAliveConfigured = await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
28
44
  if (!isCallAliveConfigured) {
45
+ const logger = videoLoggerSystem.getLogger('startForegroundService');
29
46
  logger.info('KeepCallAlive is not configured. Skipping foreground service setup.');
30
47
  return;
31
48
  }
32
- // Check for notification permission (Android 13+) before starting the service.
33
- const hasPostNotificationsPermission = Number(Platform.Version) < 33 || (await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS));
34
- if (!hasPostNotificationsPermission) {
49
+ // check for notification permission and then start the foreground service
50
+ if (!notifeeLib) return;
51
+ const settings = await notifeeLib.default.getNotificationSettings();
52
+ if (settings.authorizationStatus !== notifeeLib.AuthorizationStatus.AUTHORIZED) {
53
+ const logger = videoLoggerSystem.getLogger('startForegroundService');
35
54
  logger.info('Notification permission not granted, can not start foreground service to keep the call alive');
36
55
  return;
37
56
  }
38
57
  const videoConfig = StreamVideoRN.getConfig();
39
58
  const foregroundServiceConfig = videoConfig.foregroundService;
40
59
  const notificationTexts = foregroundServiceConfig.android.notificationTexts;
41
- const channel = foregroundServiceConfig.android.channel;
42
- const smallIconName = videoConfig.push?.android.smallIcon;
43
-
60
+ const channelId = foregroundServiceConfig.android.channel.id;
61
+ await notifeeLib.default.createChannel(foregroundServiceConfig.android.channel);
62
+ const foregroundServiceTypes = await getKeepCallAliveForegroundServiceTypes();
44
63
  // NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
45
64
  // this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
46
65
  // this crash was reproducible only in some android devices
47
- requestAnimationFrame(async () => {
48
- try {
49
- await NativeModules.StreamVideoReactNative.startKeepCallAliveService(call_cid, channel.id, channel.name, notificationTexts.title, notificationTexts.body, smallIconName ?? null);
50
- } catch (e) {
51
- logger.warn('Failed to start keep-call-alive foreground service', e);
52
- }
66
+ requestAnimationFrame(() => {
67
+ notifeeLib.default.displayNotification({
68
+ id: call_cid,
69
+ title: notificationTexts.title,
70
+ body: notificationTexts.body,
71
+ android: {
72
+ channelId,
73
+ smallIcon: videoConfig.push?.android.smallIcon,
74
+ foregroundServiceTypes,
75
+ asForegroundService: true,
76
+ ongoing: true,
77
+ // user cannot dismiss the notification
78
+ colorized: true,
79
+ pressAction: {
80
+ id: 'default',
81
+ launchActivity: 'default' // open the app when the notification is pressed
82
+ }
83
+ }
84
+ });
53
85
  });
54
86
  }
55
87
 
88
+ // flag to check if setForegroundService has already been run once
89
+ let isSetForegroundServiceRan = false;
90
+
56
91
  /**
57
92
  * This hook is used to keep the call alive in the background for Android.
58
93
  * It starts a foreground service to keep the call alive as soon as the call is joined
@@ -62,7 +97,7 @@ async function startForegroundService(call_cid) {
62
97
  export const useAndroidKeepCallAliveEffect = () => {
63
98
  const foregroundServiceStartedRef = useRef(false);
64
99
  const call = useCall();
65
- keepCallAliveCallRef.current = call;
100
+ callToPassToForegroundService.current = call;
66
101
  const activeCallCid = call?.cid;
67
102
  const {
68
103
  useCallCallingState
@@ -70,16 +105,12 @@ export const useAndroidKeepCallAliveEffect = () => {
70
105
  const callingState = useCallCallingState();
71
106
  const isOutgoingCall = callingState === CallingState.RINGING && call?.isCreatedByMe;
72
107
  const isCallJoined = callingState === CallingState.JOINED;
73
- const isRingingCall = call?.ringing;
74
108
  const shouldStartForegroundService = !foregroundServiceStartedRef.current && (isOutgoingCall || isCallJoined);
75
109
  useEffect(() => {
76
110
  if (Platform.OS === 'ios' || !activeCallCid) {
77
111
  return undefined;
78
112
  }
79
- const callingx = getCallingxLibIfAvailable();
80
- if (callingx?.isSetup && (isRingingCall || !isRingingCall && callingx?.isOngoingCallsEnabled)) {
81
- return undefined;
82
- }
113
+ if (!notifeeLib) return undefined;
83
114
 
84
115
  // start foreground service as soon as the call is joined
85
116
  if (shouldStartForegroundService) {
@@ -87,18 +118,21 @@ export const useAndroidKeepCallAliveEffect = () => {
87
118
  if (foregroundServiceStartedRef.current) {
88
119
  return;
89
120
  }
90
- // Optional compatibility cleanup: if the app uses Notifee for ringing push,
91
- // we might have an incoming call notification running as a foreground service.
92
- if (notifeeLib) {
93
- const notifee = notifeeLib.default;
94
- const displayedNotifications = await notifee.getDisplayedNotifications();
95
- const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
96
- if (activeCallNotification) {
97
- // this means that we have a incoming call notification shown as foreground service and we must stop it
98
- notifee.stopForegroundService();
99
- notifee.cancelDisplayedNotification(activeCallCid);
100
- }
121
+ if (!isSetForegroundServiceRan) {
122
+ isSetForegroundServiceRan = true;
123
+ setForegroundService();
124
+ }
125
+ const notifee = notifeeLib.default;
126
+ const displayedNotifications = await notifee.getDisplayedNotifications();
127
+ const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
128
+ if (activeCallNotification) {
129
+ callToPassToForegroundService.current = undefined;
130
+ // this means that we have a incoming call notification shown as foreground service and we must stop it
131
+ notifee.stopForegroundService();
132
+ notifee.cancelDisplayedNotification(activeCallCid);
101
133
  }
134
+ // check for notification permission and then start the foreground service
135
+
102
136
  await startForegroundService(activeCallCid);
103
137
  foregroundServiceStartedRef.current = true;
104
138
  };
@@ -106,6 +140,7 @@ export const useAndroidKeepCallAliveEffect = () => {
106
140
  // ensure that app is active before running the function
107
141
  if (AppState.currentState === 'active') {
108
142
  run();
143
+ return undefined;
109
144
  }
110
145
  const sub = AppState.addEventListener('change', nextAppState => {
111
146
  if (nextAppState === 'active') {
@@ -120,36 +155,34 @@ export const useAndroidKeepCallAliveEffect = () => {
120
155
  return () => {
121
156
  // cancel any notifee displayed notification when the call has transitioned out of ringing
122
157
  // NOTE: cancels only the non fg service notifications
123
- if (notifeeLib) {
124
- notifeeLib.default.cancelDisplayedNotification(activeCallCid);
125
- }
158
+ notifeeLib.default.cancelDisplayedNotification(activeCallCid);
126
159
  };
127
160
  } else if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
128
161
  if (foregroundServiceStartedRef.current) {
129
- keepCallAliveCallRef.current = undefined;
162
+ callToPassToForegroundService.current = undefined;
130
163
  // stop foreground service when the call is not active
131
- stopForegroundServiceNoThrow();
164
+ notifeeLib.default.stopForegroundService();
132
165
  foregroundServiceStartedRef.current = false;
133
166
  } else {
134
- if (notifeeLib) {
135
- notifeeLib.default.getDisplayedNotifications().then(displayedNotifications => {
136
- const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
137
- if (activeCallNotification) {
138
- // this means that we have a incoming call notification shown as foreground service and we must stop it
139
- notifeeLib.default.stopForegroundService();
140
- }
141
- });
142
- }
167
+ notifeeLib.default.getDisplayedNotifications().then(displayedNotifications => {
168
+ const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
169
+ if (activeCallNotification) {
170
+ callToPassToForegroundService.current = undefined;
171
+ // this means that we have a incoming call notification shown as foreground service and we must stop it
172
+ notifeeLib.default.stopForegroundService();
173
+ }
174
+ });
143
175
  }
144
176
  }
145
177
  return undefined;
146
- }, [activeCallCid, callingState, shouldStartForegroundService, isRingingCall]);
178
+ }, [activeCallCid, callingState, shouldStartForegroundService]);
147
179
  useEffect(() => {
148
180
  return () => {
149
181
  // stop foreground service when this effect is unmounted
150
182
  if (foregroundServiceStartedRef.current) {
151
- keepCallAliveCallRef.current = undefined;
152
- stopForegroundServiceNoThrow();
183
+ if (!notifeeLib) return;
184
+ callToPassToForegroundService.current = undefined;
185
+ notifeeLib.default.stopForegroundService();
153
186
  foregroundServiceStartedRef.current = false;
154
187
  }
155
188
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useCall","useCallStateHooks","useEffect","useRef","StreamVideoRN","AppState","NativeModules","PermissionsAndroid","Platform","CallingState","videoLoggerSystem","keepCallAliveCallRef","getNotifeeLibNoThrowForKeepCallAlive","getCallingxLibIfAvailable","notifeeLib","stopForegroundServiceNoThrow","logger","getLogger","StreamVideoReactNative","stopKeepCallAliveService","e","warn","startForegroundService","call_cid","isCallAliveConfigured","info","hasPostNotificationsPermission","Number","Version","check","PERMISSIONS","POST_NOTIFICATIONS","videoConfig","getConfig","foregroundServiceConfig","foregroundService","notificationTexts","android","channel","smallIconName","push","smallIcon","requestAnimationFrame","startKeepCallAliveService","id","name","title","body","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","call","current","activeCallCid","cid","useCallCallingState","callingState","isOutgoingCall","RINGING","isCreatedByMe","isCallJoined","JOINED","isRingingCall","ringing","shouldStartForegroundService","OS","undefined","callingx","isSetup","isOngoingCallsEnabled","run","notifee","default","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","currentState","sub","addEventListener","nextAppState","remove","IDLE","LEFT","then"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,aAAa,QAAQ,UAAU;AACxC,SACEC,QAAQ,EAERC,aAAa,EACbC,kBAAkB,EAClBC,QAAQ,QACH,cAAc;AACrB,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,yBAAyB;AACzE,SAASC,oBAAoB,QAAQ,oCAAoC;AACzE,SAASC,oCAAoC,QAAQ,4BAA4B;AACjF,SAASC,yBAAyB,QAAQ,oBAAoB;AAE9D,MAAMC,UAAU,GAAGF,oCAAoC,CAAC,CAAC;AAEzD,eAAeG,4BAA4BA,CAAA,EAAG;EAC5C,MAAMC,MAAM,GAAGN,iBAAiB,CAACO,SAAS,CAAC,8BAA8B,CAAC;EAC1E,IAAI;IACF,MAAMX,aAAa,CAACY,sBAAsB,CAACC,wBAAwB,CAAC,CAAC;EACvE,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVJ,MAAM,CAACK,IAAI,CAAC,mDAAmD,EAAED,CAAC,CAAC;EACrE;AACF;AAEA,eAAeE,sBAAsBA,CAACC,QAAgB,EAAE;EACt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c,SAAS;QACxC;QACAlD,4BAA4B,CAAC,CAAC;QAC9BkC,2BAA2B,CAACE,OAAO,GAAG,KAAK;MAC7C,CAAC,MAAM;QACL,IAAIrC,UAAU,EAAE;UACdA,UAAU,CAACyD,OAAO,CACfE,yBAAyB,CAAC,CAAC,CAC3Ba,IAAI,CAAEd,sBAAsB,IAAK;YAChC,MAAME,sBAAsB,GAAGF,sBAAsB,CAACG,IAAI,CACvDC,YAAY,IAAKA,YAAY,CAAChC,EAAE,KAAKQ,aACxC,CAAC;YACD,IAAIsB,sBAAsB,EAAE;cAC1B;cACA5D,UAAU,CAACyD,OAAO,CAACM,qBAAqB,CAAC,CAAC;YAC5C;UACF,CAAC,CAAC;QACN;MACF;IACF;IACA,OAAOZ,SAAS;EAClB,CAAC,EAAE,CACDb,aAAa,EACbG,YAAY,EACZQ,4BAA4B,EAC5BF,aAAa,CACd,CAAC;EAEF3D,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAI+C,2BAA2B,CAACE,OAAO,EAAE;QACvCxC,oBAAoB,CAACwC,OAAO,GAAGc,SAAS;QACxClD,4BAA4B,CAAC,CAAC;QAC9BkC,2BAA2B,CAACE,OAAO,GAAG,KAAK;MAC7C;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useCall","useCallStateHooks","useEffect","useRef","StreamVideoRN","AppState","NativeModules","Platform","CallingState","videoLoggerSystem","getKeepCallAliveForegroundServiceTypes","getNotifeeLibNoThrowForKeepCallAlive","notifeeLib","callToPassToForegroundService","current","undefined","setForegroundService","OS","StreamVideoReactNative","isCallAliveConfigured","then","isConfigured","logger","getLogger","info","default","registerForegroundService","task","Promise","resolve","videoConfig","getConfig","foregroundServiceConfig","foregroundService","taskToRun","android","call","warn","startForegroundService","call_cid","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","notificationTexts","channelId","channel","id","createChannel","foregroundServiceTypes","requestAnimationFrame","displayNotification","title","body","smallIcon","push","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","activeCallCid","cid","useCallCallingState","callingState","isOutgoingCall","RINGING","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","run","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","currentState","sub","addEventListener","nextAppState","remove","IDLE","LEFT"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,aAAa,QAAQ,UAAU;AACxC,SACEC,QAAQ,EAERC,aAAa,EACbC,QAAQ,QACH,cAAc;AACrB,SAAeC,YAAY,EAAEC,iBAAiB,QAAQ,yBAAyB;AAC/E,SACEC,sCAAsC,EACtCC,oCAAoC,QAC/B,4BAA4B;AAEnC,MAAMC,UAAU,GAAGD,oCAAoC,CAAC,CAAC;AACzD,MAAME,6BAA4D,GAAG;EACnEC,OAAO,EAAEC;AACX,CAAC;AAED,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,IAAIT,QAAQ,CAACU,EAAE,KAAK,KAAK,IAAI,CAACL,UAAU,EAAE;EAC1CN,aAAa,CAACY,sBAAsB,CAACC,qBAAqB,CAAC,CAAC,CAACC,IAAI,CAC9DC,YAAqB,IAAK;IACzB,IAAI,CAACA,YAAY,EAAE;MACjB,MAAMC,MAAM,GAAGb,iBAAiB,CAACc,SAAS,CACxC,6BACF,CAAC;MACDD,MAAM,CAACE,IAAI,CACT,qEACF,CAAC;MACD;IACF;IACAZ,UAAU,CAACa,OAAO,CAACC,yBAAyB,CAAC,MAAM;MACjD,MAAMC,IAAI,GAAG,IAAIC,OAAO,CAAEC,OAAO,IAAK;QACpC,MAAMP,MAAM,GAAGb,iBA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ACC,OAAO,GAAGC,SAAS;YACjD;YACAH,UAAU,CAACa,OAAO,CAACyD,qBAAqB,CAAC,CAAC;UAC5C;QACF,CAAC,CAAC;MACN;IACF;IACA,OAAOnE,SAAS;EAClB,CAAC,EAAE,CAACkD,aAAa,EAAEG,YAAY,EAAEM,4BAA4B,CAAC,CAAC;EAE/DxE,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAI8D,2BAA2B,CAAClD,OAAO,EAAE;QACvC,IAAI,CAACF,UAAU,EAAE;QACjBC,6BAA6B,CAACC,OAAO,GAAGC,SAAS;QACjDH,UAAU,CAACa,OAAO,CAACyD,qBAAqB,CAAC,CAAC;QAC1ClB,2BAA2B,CAAClD,OAAO,GAAG,KAAK;MAC7C;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
@@ -9,7 +9,6 @@ import { registerGlobals } from '@stream-io/react-native-webrtc';
9
9
  import Logger from '@stream-io/react-native-webrtc/src/Logger';
10
10
  import { Platform } from 'react-native';
11
11
  import { registerSDKGlobals } from './utils/internal/registerSDKGlobals';
12
- import './utils/keepCallAliveHeadlessTask';
13
12
 
14
13
  // We're registering globals, because our video JS client is serving SDKs that use browser based webRTC functions.
15
14
  // This will result in creation of 2 global objects: `window` and `navigator`
@@ -1 +1 @@
1
- {"version":3,"names":["setClientDetails","registerGlobals","Logger","Platform","registerSDKGlobals","OS","enable","ROOT_PREFIX","StreamVideo","StreamCall"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAC3D;AACA,OAAO,wBAAwB;AAC/B;AACA,OAAO,gCAAgC;AACvC;AACA,OAAO,kBAAkB;AACzB,SAASC,eAAe,QAAQ,gCAAgC;AAChE,OAAOC,MAAM,MAAM,2CAA2C;AAC9D,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,qCAAqC;AACxE,OAAO,mCAAmC;;AAE1C;AACA;AACA;AACA,IAAID,QAAQ,CAACE,EAAE,KAAK,KAAK,EAAE;EACzBJ,eAAe,CAAC,CAAC;EACjBG,kBAAkB,CAAC,CAAC;AACtB;;AAEA;AACAF,MAAM,CAACI,MAAM,CAAC,GAAGJ,MAAM,CAACK,WAAW,eAAe,CAAC;AAEnD,cAAc,yBAAyB;AACvC,cAAc,iCAAiC;AAC/C,cAAc,cAAc;AAC5B,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAC9B,cAAc,wBAAwB;;AAEtC;AACA;AACA,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,cAAc,+BAA+B;AAE7CT,gBAAgB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["setClientDetails","registerGlobals","Logger","Platform","registerSDKGlobals","OS","enable","ROOT_PREFIX","StreamVideo","StreamCall"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAC3D;AACA,OAAO,wBAAwB;AAC/B;AACA,OAAO,gCAAgC;AACvC;AACA,OAAO,kBAAkB;AACzB,SAASC,eAAe,QAAQ,gCAAgC;AAChE,OAAOC,MAAM,MAAM,2CAA2C;AAC9D,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,qCAAqC;;AAExE;AACA;AACA;AACA,IAAID,QAAQ,CAACE,EAAE,KAAK,KAAK,EAAE;EACzBJ,eAAe,CAAC,CAAC;EACjBG,kBAAkB,CAAC,CAAC;AACtB;;AAEA;AACAF,MAAM,CAACI,MAAM,CAAC,GAAGJ,MAAM,CAACK,WAAW,eAAe,CAAC;AAEnD,cAAc,yBAAyB;AACvC,cAAc,iCAAiC;AAC/C,cAAc,cAAc;AAC5B,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAC9B,cAAc,wBAAwB;;AAEtC;AACA;AACA,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,cAAc,+BAA+B;AAE7CT,gBAAgB,CAAC,CAAC","ignoreList":[]}
@@ -1,8 +1,5 @@
1
1
  import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
- import { getCallingxLibIfAvailable } from '../../utils/push/libs/callingx';
3
- import { videoLoggerSystem } from '@stream-io/video-client';
4
2
  const NativeManager = NativeModules.StreamInCallManager;
5
- const CallingxModule = getCallingxLibIfAvailable();
6
3
  const invariant = (condition, message) => {
7
4
  if (!condition) throw new Error(message);
8
5
  };
@@ -64,15 +61,6 @@ class SpeakerManager {
64
61
  NativeManager.setForceSpeakerphoneOn(force);
65
62
  };
66
63
  }
67
- const shouldBypassForCallKit = () => {
68
- if (Platform.OS !== 'ios') {
69
- return false;
70
- }
71
- if (!CallingxModule) {
72
- return false;
73
- }
74
- return CallingxModule.isSetup && (CallingxModule.hasRegisteredCall() || CallingxModule.isOngoingCallsEnabled);
75
- };
76
64
  export class CallManager {
77
65
  android = new AndroidCallManager();
78
66
  ios = new IOSCallManager();
@@ -96,10 +84,6 @@ export class CallManager {
96
84
  * @param config.enableStereoAudioOutput Whether to enable stereo audio output. Only supported for listener audio role.
97
85
  */
98
86
  start = config => {
99
- if (shouldBypassForCallKit()) {
100
- videoLoggerSystem.getLogger('CallManager').debug('start: skipping start as callkit is handling the audio session');
101
- return;
102
- }
103
87
  NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
104
88
  if (config?.audioRole === 'communicator') {
105
89
  const type = config.deviceEndpointType ?? 'speaker';
@@ -115,10 +99,6 @@ export class CallManager {
115
99
  * Stops the in call manager.
116
100
  */
117
101
  stop = () => {
118
- if (shouldBypassForCallKit()) {
119
- videoLoggerSystem.getLogger('CallManager').debug('stop: skipping stop as callkit is handling the audio session');
120
- return;
121
- }
122
102
  NativeManager.stop();
123
103
  };
124
104
 
@@ -127,11 +107,5 @@ export class CallManager {
127
107
  * in the native layer.
128
108
  */
129
109
  logAudioState = () => NativeManager.logAudioState();
130
-
131
- /**
132
- * For debugging purposes, returns the current audio state as a string.
133
- * @returns A string containing the current audio state information.
134
- */
135
- getAudioStateLog = () => NativeManager.getAudioStateLog();
136
110
  }
137
111
  //# sourceMappingURL=CallManager.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","getCallingxLibIfAvailable","videoLoggerSystem","NativeManager","StreamInCallManager","CallingxModule","invariant","condition","message","Error","AndroidCallManager","getAudioDeviceStatus","OS","selectAudioDevice","endpointName","chooseAudioDeviceEndpoint","addAudioDeviceChangeListener","onChange","eventEmitter","s","addListener","remove","IOSCallManager","showDeviceSelector","showAudioRoutePicker","SpeakerManager","setMute","mute","muteAudioOutput","unmuteAudioOutput","setForceSpeakerphoneOn","force","shouldBypassForCallKit","isSetup","hasRegisteredCall","isOngoingCallsEnabled","CallManager","android","ios","speaker","start","config","getLogger","debug","setAudioRole","audioRole","type","deviceEndpointType","setDefaultAudioDeviceEndpointType","enableStereoAudioOutput","setEnableStereoAudioOutput","stop","logAudioState","getAudioStateLog"],"sourceRoot":"../../../../src","sources":["modules/call-manager/CallManager.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAE1E,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,MAAMC,aAAa,GAAGJ,aAAa,CAACK,mBAAmB;AACvD,MAAMC,cAAc,GAAGJ,yBAAyB,CAAC,CAAC;AAElD,MAAMK,SAAS,GAAGA,CAACC,SAAkB,EAAEC,OAAe,KAAK;EACzD,IAAI,CAACD,SAAS,EAAE,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;AAC1C,CAAC;AAED,MAAME,kBAAkB,CAAC;EAGvB;AACF;AACA;EACEC,oBAAoB,GA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AiB,CACdwC,SAAS,CAAC,aAAa,CAAC,CACxBC,KAAK,CAAC,8DAA8D,CAAC;MACxE;IACF;IACAxC,aAAa,CAACgD,IAAI,CAAC,CAAC;EACtB,CAAC;;EAED;AACF;AACA;AACA;EACEC,aAAa,GAAGA,CAAA,KAAYjD,aAAa,CAACiD,aAAa,CAAC,CAAC;;EAEzD;AACF;AACA;AACA;EACEC,gBAAgB,GAAGA,CAAA,KAAclD,aAAa,CAACkD,gBAAgB,CAAC,CAAC;AACnE","ignoreList":[]}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","NativeManager","StreamInCallManager","invariant","condition","message","Error","AndroidCallManager","getAudioDeviceStatus","OS","selectAudioDevice","endpointName","chooseAudioDeviceEndpoint","addAudioDeviceChangeListener","onChange","eventEmitter","s","addListener","remove","IOSCallManager","showDeviceSelector","showAudioRoutePicker","SpeakerManager","setMute","mute","muteAudioOutput","unmuteAudioOutput","setForceSpeakerphoneOn","force","CallManager","android","ios","speaker","start","config","setAudioRole","audioRole","type","deviceEndpointType","setDefaultAudioDeviceEndpointType","enableStereoAudioOutput","setEnableStereoAudioOutput","stop","logAudioState"],"sourceRoot":"../../../../src","sources":["modules/call-manager/CallManager.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAG1E,MAAMC,aAAa,GAAGF,aAAa,CAACG,mBAAmB;AAEvD,MAAMC,SAAS,GAAGA,CAACC,SAAkB,EAAEC,OAAe,KAAK;EACzD,IAAI,CAACD,SAAS,EAAE,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;AAC1C,CAAC;AAED,MAAME,kBAAkB,CAAC;EAGvB;AACF;AACA;EACEC,oBAAoB,GAAG,MAAAA,CAAA,KAAwC;IAC7DL,SAAS,CAACH,QAAQ,CAACS,EAAE,KAAK,SAAS,EAAE,2BAA2B,CAAC;IACjE,OAAOR,aAAa,CAACO,oBAAoB,CAAC,CAAC;EAC7C,CAAC;;E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AC,CAAC;;EAE9B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEW,KAAK,GAAIC,MAAkC,IAAW;IACpDjC,aAAa,CAACkC,YAAY,CAACD,MAAM,EAAEE,SAAS,IAAI,cAAc,CAAC;IAC/D,IAAIF,MAAM,EAAEE,SAAS,KAAK,cAAc,EAAE;MACxC,MAAMC,IAAI,GAAGH,MAAM,CAACI,kBAAkB,IAAI,SAAS;MACnDrC,aAAa,CAACsC,iCAAiC,CAACF,IAAI,CAAC;IACvD;IACA,IAAIH,MAAM,EAAEE,SAAS,KAAK,UAAU,IAAIF,MAAM,CAACM,uBAAuB,EAAE;MACtEvC,aAAa,CAACwC,0BAA0B,CAAC,IAAI,CAAC;IAChD;IACAxC,aAAa,CAACgC,KAAK,CAAC,CAAC;EACvB,CAAC;;EAED;AACF;AACA;EACES,IAAI,GAAGA,CAAA,KAAY;IACjBzC,aAAa,CAACyC,IAAI,CAAC,CAAC;EACtB,CAAC;;EAED;AACF;AACA;AACA;EACEC,aAAa,GAAGA,CAAA,KAAY1C,aAAa,CAAC0C,aAAa,CAAC,CAAC;AAC3D","ignoreList":[]}
@@ -1,11 +1,11 @@
1
1
  import { StreamCallProvider } from '@stream-io/video-react-bindings';
2
2
  import React, { useEffect } from 'react';
3
+ import { useIosCallkeepWithCallingStateEffect } from '../../hooks/push/useIosCallkeepWithCallingStateEffect';
3
4
  import { canAddPushWSSubscriptionsRef } from '../../utils/push/internal/utils';
4
5
  import { useAndroidKeepCallAliveEffect } from '../../hooks/useAndroidKeepCallAliveEffect';
5
6
  import { AppStateListener } from './AppStateListener';
6
7
  import { DeviceStats } from './DeviceStats';
7
8
  import { pushUnsubscriptionCallbacks } from '../../utils/push/internal/constants';
8
- import { useCallingExpWithCallingStateEffect } from '../../hooks/push/useCallingExpWithCallingStateEffect';
9
9
 
10
10
  // const PIP_CHANGE_EVENT = 'StreamVideoReactNative_PIP_CHANGE_EVENT';
11
11
 
@@ -24,7 +24,7 @@ export const StreamCall = ({
24
24
  }) => {
25
25
  return /*#__PURE__*/React.createElement(StreamCallProvider, {
26
26
  call: call
27
- }, /*#__PURE__*/React.createElement(AppStateListener, null), /*#__PURE__*/React.createElement(AndroidKeepCallAlive, null), /*#__PURE__*/React.createElement(CallingExpWithCallingState, null), /*#__PURE__*/React.createElement(ClearPushWSSubscriptions, null), /*#__PURE__*/React.createElement(DeviceStats, null), children);
27
+ }, /*#__PURE__*/React.createElement(AppStateListener, null), /*#__PURE__*/React.createElement(AndroidKeepCallAlive, null), /*#__PURE__*/React.createElement(IosInformCallkeepCallEnd, null), /*#__PURE__*/React.createElement(ClearPushWSSubscriptions, null), /*#__PURE__*/React.createElement(DeviceStats, null), children);
28
28
  };
29
29
 
30
30
  /**
@@ -37,11 +37,11 @@ const AndroidKeepCallAlive = () => {
37
37
  };
38
38
 
39
39
  /**
40
- * This is a renderless component to sync state between stream call and CallKit/Telecom.
41
- * useCallingExpWithCallingStateEffect needs to called inside a child of StreamCallProvider.
40
+ * This is a renderless component to end the call in callkeep for ios.
41
+ * useAndroidKeepCallAliveEffect needs to called inside a child of StreamCallProvider.
42
42
  */
43
- const CallingExpWithCallingState = () => {
44
- useCallingExpWithCallingStateEffect();
43
+ const IosInformCallkeepCallEnd = () => {
44
+ useIosCallkeepWithCallingStateEffect();
45
45
  return null;
46
46
  };
47
47
 
@@ -1 +1 @@
1
- {"version":3,"names":["StreamCallProvider","React","useEffect","canAddPushWSSubscriptionsRef","useAndroidKeepCallAliveEffect","AppStateListener","DeviceStats","pushUnsubscriptionCallbacks","useCallingExpWithCallingStateEffect","StreamCall","call","children","createElement","AndroidKeepCallAlive","CallingExpWithCallingState","ClearPushWSSubscriptions","forEach","cbArray","cb","clear","current"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,OAAOC,KAAK,IAA4BC,SAAS,QAAQ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,GAAG,KAAK;IAC5C,OAAO,MAAM;MACXjB,4BAA4B,CAACiB,OAAO,GAAG,IAAI;IAC7C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EACN,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["StreamCallProvider","React","useEffect","useIosCallkeepWithCallingStateEffect","canAddPushWSSubscriptionsRef","useAndroidKeepCallAliveEffect","AppStateListener","DeviceStats","pushUnsubscriptionCallbacks","StreamCall","call","children","createElement","AndroidKeepCallAlive","IosInformCallkeepCallEnd","ClearPushWSSubscriptions","forEach","cbArray","cb","clear","current"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,OAAOC,KAAK,IAA4BC,SAAS,QAAQ,OAAO;AAEhE,SAASC,oCAAoC,QAAQ,uDAAuD;AAC5G,SAASC,4BAA4B,QAAQ,iCAAiC;AAC9E,SAASC,6BAA6B,QAAQ,2CAA2C;AACzF,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,2BAA2B,QAAQ,qCAAqC;;AAEjF;;AAEA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,IAAI;EACJC;AACkC,CAAC,KAAK;EACxC,oBACEV,KAAA,CAAAW,aAAA,CAACZ,kBAAkB;IAACU,IAAI,EAAEA;EAAK,gBAC7BT,KAAA,CAAAW,aAAA,CAACN,gBAAgB,MAAE,CAAC,eACpBL,KAAA,CAAAW,aAAA,CAACC,oBAAoB,MAAE,CAAC,eACxBZ,KAAA,CAAAW,aAAA,CAACE,wBAAwB,MAAE,CAAC,eAC5Bb,KAAA,CAAAW,aAAA,CAACG,wBAAwB,MAAE,CAAC,eAC5Bd,KAAA,CAAAW,aAAA,CAACL,WAAW,MAAE,CAAC,EACdI,QACiB,CAAC;AAEzB,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAME,oBAAoB,GAAGA,CAAA,KAAM;EACjCR,6BAA6B,CAAC,CAAC;EAC/B,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMS,wBAAwB,GAAGA,CAAA,KAAM;EACrCX,oCAAoC,CAAC,CAAC;EACtC,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMY,wBAAwB,GAAGA,CAAA,KAAM;EACrCb,SAAS,CAAC,MAAM;IACd;IACAM,2BAA2B,CAACQ,OAAO,CAAEC,OAAO,IAC1CA,OAAO,CAACD,OAAO,CAAEE,EAAE,IAAKA,EAAE,CAAC,CAAC,CAC9B,CAAC;IACDV,2BAA2B,CAACW,KAAK,CAAC,CAAC;IACnCf,4BAA4B,CAACgB,OAAO,GAAG,KAAK;IAC5C,OAAO,MAAM;MACXhB,4BAA4B,CAACgB,OAAO,GAAG,IAAI;IAC7C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EACN,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
@@ -1,10 +1,8 @@
1
1
  import pushLogoutCallbacks from '../internal/pushLogoutCallback';
2
2
  import newNotificationCallbacks from '../internal/newNotificationCallbacks';
3
+ import { setupIosCallKeepEvents } from '../push/setupIosCallKeepEvents';
3
4
  import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
4
- import { setupCallingExpEvents } from '../push/setupCallingExpEvents';
5
- import { extractCallingExpOptions, getCallingxLib } from '../push/libs/callingx';
6
5
  import { NativeModules, Platform } from 'react-native';
7
- import { videoLoggerSystem } from '@stream-io/video-client';
8
6
 
9
7
  // Utility type for deep partial
10
8
 
@@ -29,7 +27,10 @@ const DEFAULT_STREAM_VIDEO_CONFIG = {
29
27
  android: {
30
28
  channel: {
31
29
  id: 'stream_call_foreground_service',
32
- name: 'Ongoing calls'
30
+ name: 'To keep calls alive',
31
+ lights: false,
32
+ vibration: false,
33
+ importance: 3
33
34
  },
34
35
  notificationTexts: {
35
36
  title: 'Call in progress',
@@ -51,6 +52,15 @@ export class StreamVideoRN {
51
52
  static updateConfig(updateConfig) {
52
53
  this.config = deepMerge(this.config, updateConfig);
53
54
  }
55
+ static updateAndroidIncomingCallChannel(updateChannel) {
56
+ const prevChannel = this.config.push?.android?.incomingCallChannel;
57
+ if (prevChannel) {
58
+ this.config.push.android.incomingCallChannel = {
59
+ ...prevChannel,
60
+ ...updateChannel
61
+ };
62
+ }
63
+ }
54
64
 
55
65
  /**
56
66
  * Set the push config for StreamVideoRN.
@@ -64,26 +74,7 @@ export class StreamVideoRN {
64
74
  * import App from './App';
65
75
  * // Set push config
66
76
  * const pushConfig = {}; // construct your config
67
- * // Set CallKit/Android Telecom API integration options. All params are optional. If not provided, the default values will be used.
68
- * const callingExpOptions = {
69
- * ios: {
70
- * callsHistory: true,
71
- * displayCallTimeout: 60000,
72
- * sound: 'ringtone',
73
- * imageName: 'callkit_icon',
74
- * },
75
- * android: {
76
- * incomingChannel: {
77
- * id: 'stream_incoming_call_notifications',
78
- * name: 'Call notifications',
79
- * vibration: true,
80
- * sound: 'default',
81
- * },
82
- * titleTransformer: (text: string) => text,
83
- * subtitleTransformer: (text: string) => text,
84
- * },
85
- * };
86
- * StreamVideoRN.setPushConfig(pushConfig, callingExpOptions);
77
+ * StreamVideoRN.setPushConfig(pushConfig);
87
78
  * AppRegistry.registerComponent('app', () => App);
88
79
  */
89
80
  static setPushConfig(pushConfig) {
@@ -91,16 +82,13 @@ export class StreamVideoRN {
91
82
  // Ignoring this config as push config was already set
92
83
  return;
93
84
  }
94
- this.config.push = pushConfig;
95
- try {
96
- const callingx = getCallingxLib();
97
- videoLoggerSystem.getLogger('StreamVideoRN.setPushConfig').info(JSON.stringify(this.config));
98
- const options = extractCallingExpOptions(this.config);
99
- callingx.setup(options);
100
- } catch {
101
- throw new Error('react-native-callingx library is not installed. Please check the installation instructions: https://getstream.io/video/docs/react-native/incoming-calls/ringing-setup/react-native/.');
85
+ if (__DEV__ && (pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)) {
86
+ throw new Error(`Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
87
+ Please watch for incoming and outgoing calls in the root component of your app.
88
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`);
102
89
  }
103
- setupCallingExpEvents(pushConfig);
90
+ this.config.push = pushConfig;
91
+ setupIosCallKeepEvents(pushConfig);
104
92
  setupIosVoipPushEvents(pushConfig);
105
93
  }
106
94
  static getConfig() {