@stream-io/video-react-native-sdk 1.29.3 → 1.29.4-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 (209) hide show
  1. package/android/src/main/AndroidManifest.xml +8 -1
  2. package/android/src/main/AndroidManifestNew.xml +11 -0
  3. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +42 -5
  4. package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +70 -6
  5. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +6 -4
  6. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +83 -0
  7. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +149 -0
  8. package/dist/commonjs/hooks/push/index.js +0 -2
  9. package/dist/commonjs/hooks/push/index.js.map +1 -1
  10. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +121 -0
  11. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
  12. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
  13. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  14. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +64 -97
  15. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  16. package/dist/commonjs/index.js +1 -0
  17. package/dist/commonjs/index.js.map +1 -1
  18. package/dist/commonjs/modules/call-manager/CallManager.js +26 -0
  19. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  20. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  21. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  22. package/dist/commonjs/utils/StreamVideoRN/index.js +33 -21
  23. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  24. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +58 -0
  25. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +1 -0
  26. package/dist/commonjs/utils/internal/callingx/callingx.js +109 -0
  27. package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -0
  28. package/dist/commonjs/utils/internal/registerSDKGlobals.js +52 -3
  29. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  30. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +48 -0
  31. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +1 -0
  32. package/dist/commonjs/utils/push/android.js +151 -202
  33. package/dist/commonjs/utils/push/android.js.map +1 -1
  34. package/dist/commonjs/utils/push/internal/ios.js +17 -34
  35. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  36. package/dist/commonjs/utils/push/internal/rxSubjects.js +1 -45
  37. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  38. package/dist/commonjs/utils/push/internal/utils.js +32 -20
  39. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  40. package/dist/commonjs/utils/push/ios.js.map +1 -1
  41. package/dist/commonjs/utils/push/libs/callingx.js +75 -0
  42. package/dist/commonjs/utils/push/libs/callingx.js.map +1 -0
  43. package/dist/commonjs/utils/push/libs/index.js +8 -19
  44. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  45. package/dist/commonjs/utils/push/libs/notifee/index.js +0 -19
  46. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  47. package/dist/commonjs/utils/push/setupCallingExpEvents.js +108 -0
  48. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -0
  49. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +7 -6
  50. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  51. package/dist/commonjs/version.js +1 -1
  52. package/dist/commonjs/version.js.map +1 -1
  53. package/dist/module/hooks/push/index.js +0 -2
  54. package/dist/module/hooks/push/index.js.map +1 -1
  55. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +114 -0
  56. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
  57. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
  58. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  59. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +66 -99
  60. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  61. package/dist/module/index.js +1 -0
  62. package/dist/module/index.js.map +1 -1
  63. package/dist/module/modules/call-manager/CallManager.js +26 -0
  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 +33 -21
  68. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  69. package/dist/module/utils/internal/callingx/audioSessionPromise.js +51 -0
  70. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +1 -0
  71. package/dist/module/utils/internal/callingx/callingx.js +100 -0
  72. package/dist/module/utils/internal/callingx/callingx.js.map +1 -0
  73. package/dist/module/utils/internal/registerSDKGlobals.js +52 -3
  74. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  75. package/dist/module/utils/keepCallAliveHeadlessTask.js +42 -0
  76. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +1 -0
  77. package/dist/module/utils/push/android.js +153 -204
  78. package/dist/module/utils/push/android.js.map +1 -1
  79. package/dist/module/utils/push/internal/ios.js +17 -34
  80. package/dist/module/utils/push/internal/ios.js.map +1 -1
  81. package/dist/module/utils/push/internal/rxSubjects.js +0 -44
  82. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  83. package/dist/module/utils/push/internal/utils.js +29 -19
  84. package/dist/module/utils/push/internal/utils.js.map +1 -1
  85. package/dist/module/utils/push/ios.js.map +1 -1
  86. package/dist/module/utils/push/libs/callingx.js +67 -0
  87. package/dist/module/utils/push/libs/callingx.js.map +1 -0
  88. package/dist/module/utils/push/libs/index.js +1 -2
  89. package/dist/module/utils/push/libs/index.js.map +1 -1
  90. package/dist/module/utils/push/libs/notifee/index.js +0 -18
  91. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  92. package/dist/module/utils/push/setupCallingExpEvents.js +102 -0
  93. package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -0
  94. package/dist/module/utils/push/setupIosVoipPushEvents.js +7 -6
  95. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  96. package/dist/module/version.js +1 -1
  97. package/dist/module/version.js.map +1 -1
  98. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  99. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +5 -0
  100. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -0
  101. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  102. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  103. package/dist/typescript/index.d.ts +1 -0
  104. package/dist/typescript/index.d.ts.map +1 -1
  105. package/dist/typescript/modules/call-manager/CallManager.d.ts +5 -0
  106. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  107. package/dist/typescript/utils/StreamVideoRN/index.d.ts +20 -2
  108. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  109. package/dist/typescript/utils/StreamVideoRN/types.d.ts +54 -29
  110. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  111. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +16 -0
  112. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +1 -0
  113. package/dist/typescript/utils/internal/callingx/callingx.d.ts +14 -0
  114. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -0
  115. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  116. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +10 -0
  117. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +1 -0
  118. package/dist/typescript/utils/push/android.d.ts +1 -2
  119. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  120. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  121. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +0 -33
  122. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  123. package/dist/typescript/utils/push/internal/utils.d.ts +8 -1
  124. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  125. package/dist/typescript/utils/push/ios.d.ts +1 -2
  126. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  127. package/dist/typescript/utils/push/libs/callingx.d.ts +9 -0
  128. package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -0
  129. package/dist/typescript/utils/push/libs/index.d.ts +1 -2
  130. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  131. package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -1
  132. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  133. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +8 -0
  134. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -0
  135. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  136. package/dist/typescript/version.d.ts +1 -1
  137. package/dist/typescript/version.d.ts.map +1 -1
  138. package/expo-config-plugin/dist/withAndroidManifest.js +1 -33
  139. package/expo-config-plugin/dist/withAndroidPermissions.js +2 -7
  140. package/expo-config-plugin/dist/withAppDelegate.js +19 -197
  141. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  142. package/expo-config-plugin/dist/withiOSInfoPlist.js +2 -3
  143. package/ios/StreamInCallManager.m +2 -0
  144. package/ios/StreamInCallManager.swift +19 -7
  145. package/ios/StreamVideoReactNative.h +7 -4
  146. package/ios/StreamVideoReactNative.m +189 -82
  147. package/package.json +13 -18
  148. package/src/hooks/push/index.ts +0 -2
  149. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +147 -0
  150. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +21 -34
  151. package/src/hooks/useAndroidKeepCallAliveEffect.ts +94 -120
  152. package/src/index.ts +1 -0
  153. package/src/modules/call-manager/CallManager.ts +36 -0
  154. package/src/modules/call-manager/native-module.d.ts +7 -0
  155. package/src/providers/StreamCall/index.tsx +6 -6
  156. package/src/utils/StreamVideoRN/index.ts +40 -30
  157. package/src/utils/StreamVideoRN/types.ts +56 -29
  158. package/src/utils/internal/callingx/audioSessionPromise.ts +53 -0
  159. package/src/utils/internal/callingx/callingx.ts +146 -0
  160. package/src/utils/internal/registerSDKGlobals.ts +47 -4
  161. package/src/utils/keepCallAliveHeadlessTask.ts +54 -0
  162. package/src/utils/push/android.ts +227 -309
  163. package/src/utils/push/internal/ios.ts +28 -44
  164. package/src/utils/push/internal/rxSubjects.ts +0 -61
  165. package/src/utils/push/internal/utils.ts +45 -26
  166. package/src/utils/push/ios.ts +1 -6
  167. package/src/utils/push/libs/callingx.ts +90 -0
  168. package/src/utils/push/libs/index.ts +1 -2
  169. package/src/utils/push/libs/notifee/index.ts +0 -27
  170. package/src/utils/push/setupCallingExpEvents.ts +130 -0
  171. package/src/utils/push/setupIosVoipPushEvents.ts +11 -7
  172. package/src/version.ts +1 -1
  173. package/CHANGELOG.md +0 -3144
  174. package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +0 -95
  175. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -160
  176. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
  177. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +0 -67
  178. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +0 -1
  179. package/dist/commonjs/utils/push/libs/callkeep.js +0 -17
  180. package/dist/commonjs/utils/push/libs/callkeep.js.map +0 -1
  181. package/dist/commonjs/utils/push/libs/voipPushNotification.js +0 -17
  182. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +0 -1
  183. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +0 -205
  184. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +0 -1
  185. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -153
  186. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
  187. package/dist/module/hooks/push/useProcessPushCallEffect.js +0 -60
  188. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +0 -1
  189. package/dist/module/utils/push/libs/callkeep.js +0 -11
  190. package/dist/module/utils/push/libs/callkeep.js.map +0 -1
  191. package/dist/module/utils/push/libs/voipPushNotification.js +0 -11
  192. package/dist/module/utils/push/libs/voipPushNotification.js.map +0 -1
  193. package/dist/module/utils/push/setupIosCallKeepEvents.js +0 -199
  194. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +0 -1
  195. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +0 -5
  196. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +0 -1
  197. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +0 -8
  198. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +0 -1
  199. package/dist/typescript/utils/push/libs/callkeep.d.ts +0 -3
  200. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +0 -1
  201. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +0 -3
  202. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +0 -1
  203. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +0 -6
  204. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +0 -1
  205. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +0 -235
  206. package/src/hooks/push/useProcessPushCallEffect.ts +0 -108
  207. package/src/utils/push/libs/callkeep.ts +0 -16
  208. package/src/utils/push/libs/voipPushNotification.ts +0 -17
  209. package/src/utils/push/setupIosCallKeepEvents.ts +0 -252
@@ -1,5 +1,4 @@
1
1
  import { useIosVoipPushEventsSetupEffect } from './useIosVoipPushEventsSetupEffect';
2
- import { useProcessPushCallEffect } from './useProcessPushCallEffect';
3
2
  import { useInitAndroidTokenAndRest } from './useInitAndroidTokenAndRest';
4
3
  import { useIosInitRemoteNotifications } from './useIosInitRemoteNotifications';
5
4
  import { useProcessPushNonRingingCallEffect } from './useProcessPushNonRingingCallEffect';
@@ -12,7 +11,6 @@ export const usePushRegisterEffect = () => {
12
11
  useIosInitRemoteNotifications();
13
12
  useIosVoipPushEventsSetupEffect();
14
13
  useProcessPushNonRingingCallEffect();
15
- useProcessPushCallEffect();
16
14
  useInitAndroidTokenAndRest();
17
15
  };
18
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useIosVoipPushEventsSetupEffect","useProcessPushCallEffect","useInitAndroidTokenAndRest","useIosInitRemoteNotifications","useProcessPushNonRingingCallEffect","usePushRegisterEffect"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,kCAAkC,QAAQ,sCAAsC;;AAEzF;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACzCF,6BAA6B,CAAC,CAAC;EAC/BH,+BAA+B,CAAC,CAAC;EACjCI,kCAAkC,CAAC,CAAC;EACpCH,wBAAwB,CAAC,CAAC;EAC1BC,0BAA0B,CAAC,CAAC;AAC9B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useIosVoipPushEventsSetupEffect","useInitAndroidTokenAndRest","useIosInitRemoteNotifications","useProcessPushNonRingingCallEffect","usePushRegisterEffect"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,kCAAkC,QAAQ,sCAAsC;;AAEzF;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACzCF,6BAA6B,CAAC,CAAC;EAC/BF,+BAA+B,CAAC,CAAC;EACjCG,kCAAkC,CAAC,CAAC;EACpCF,0BAA0B,CAAC,CAAC;AAC9B,CAAC","ignoreList":[]}
@@ -0,0 +1,114 @@
1
+ import { videoLoggerSystem } from '@stream-io/video-client';
2
+ import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
3
+ import { useEffect, useMemo } from 'react';
4
+ import { getCallDisplayName } from '../../utils/internal/callingx/callingx';
5
+ import { getCallingxLibIfAvailable } from '../../utils/push/libs/callingx';
6
+ const logger = videoLoggerSystem.getLogger('callingx');
7
+
8
+ /**
9
+ * This hook is used to inform sync call state with CallKit/Telecom (i.e. start call, end call, mute/unmute call).
10
+ */
11
+ export const useCallingExpWithCallingStateEffect = () => {
12
+ const {
13
+ useMicrophoneState,
14
+ useParticipants,
15
+ useCallMembers
16
+ } = useCallStateHooks();
17
+ const activeCall = useCall();
18
+ const {
19
+ isMute,
20
+ microphone
21
+ } = useMicrophoneState();
22
+ const callMembers = useCallMembers();
23
+ const participants = useParticipants();
24
+ const activeCallCid = activeCall?.cid;
25
+ const currentUserId = activeCall?.currentUserId;
26
+ const callDisplayName = useMemo(() => getCallDisplayName(callMembers, participants, currentUserId), [callMembers, participants, currentUserId]);
27
+ useEffect(() => {
28
+ return () => {
29
+ const callingx = getCallingxLibIfAvailable();
30
+ if (!callingx?.isSetup || !activeCallCid) {
31
+ return;
32
+ }
33
+ const isCallTracked = callingx.isCallTracked(activeCallCid);
34
+ if (!isCallTracked) {
35
+ logger.debug(`useCallingExpWithCallingStateEffect:No active call cid to end in calling exp: ${activeCallCid} isCallTracked: ${isCallTracked}`);
36
+ return;
37
+ }
38
+ //if incoming stream call was unmounted, we need to end the call in CallKit/Telecom
39
+ logger.debug(`useCallingExpWithCallingStateEffect: Ending call in callingx: ${activeCallCid}`);
40
+ callingx.endCallWithReason(activeCallCid, 'local').catch(error => {
41
+ logger.error(`useCallingExpWithCallingStateEffect: Error ending call in callingx: ${activeCallCid}`, error);
42
+ });
43
+ };
44
+ }, [activeCallCid]);
45
+ useEffect(() => {
46
+ const callingx = getCallingxLibIfAvailable();
47
+ if (!callingx?.isSetup || !activeCallCid) {
48
+ return;
49
+ }
50
+ const isCallTracked = callingx.isCallTracked(activeCallCid);
51
+ if (!isCallTracked) {
52
+ logger.debug(`useCallingExpWithCallingStateEffect:No active call cid to update callingx: ${activeCallCid} isCallTracked: ${isCallTracked}`);
53
+ return;
54
+ }
55
+ callingx.updateDisplay(activeCallCid, activeCallCid, callDisplayName);
56
+ }, [activeCallCid, callDisplayName]);
57
+
58
+ // Sync microphone mute state from app → CallKit
59
+ useEffect(() => {
60
+ const callingx = getCallingxLibIfAvailable();
61
+ if (!callingx?.isSetup || !activeCallCid) {
62
+ return;
63
+ }
64
+ const isCallTracked = callingx.isCallTracked(activeCallCid);
65
+ if (!isCallTracked) {
66
+ logger.debug(`useCallingExpWithCallingStateEffect: No active call cid to set muted in calling exp: ${activeCallCid} isCallTracked: ${isCallTracked}`);
67
+ return;
68
+ }
69
+ callingx.setMutedCall(activeCallCid, isMute);
70
+ }, [activeCallCid, isMute]);
71
+
72
+ // Sync mute state from CallKit → app (only for system-initiated mute actions)
73
+ useEffect(() => {
74
+ const callingx = getCallingxLibIfAvailable();
75
+ if (!callingx?.isSetup || !activeCallCid) {
76
+ logger.debug(`useCallingExpWithCallingStateEffect: No active call cid to set muted in calling exp: ${activeCallCid} callingx isSetup: ${callingx?.isSetup}`);
77
+ return;
78
+ }
79
+
80
+ // Listen to mic toggle events from CallKit/Telecom and update stream call microphone state.
81
+ // Only system-initiated mute actions (e.g. user tapped mute on the native CallKit UI)
82
+ // are sent here — app-initiated actions are filtered out on the native side to prevent
83
+ // the feedback loop: app mutes mic → setMutedCall → CallKit delegate → event to JS → loop.
84
+ const subscription = callingx.addEventListener('didPerformSetMutedCallAction', async event => {
85
+ const {
86
+ callId,
87
+ muted
88
+ } = event;
89
+ const isCallTracked = callingx.isCallTracked(activeCallCid);
90
+ if (!isCallTracked || callId !== activeCallCid) {
91
+ logger.debug(`useCallingExpWithCallingStateEffect: No active call cid to set muted in calling exp: ${activeCallCid} isCallTracked: ${isCallTracked} callId: ${callId}`);
92
+ return;
93
+ }
94
+ const isCurrentlyMuted = microphone.state.status === 'disabled';
95
+ if (isCurrentlyMuted === muted) {
96
+ logger.debug(`useCallingExpWithCallingStateEffect: Mic toggle is already in the desired state: ${muted} for call: ${activeCallCid}`);
97
+ return;
98
+ }
99
+ try {
100
+ if (muted) {
101
+ await microphone.disable();
102
+ } else {
103
+ await microphone.enable();
104
+ }
105
+ } catch (error) {
106
+ logger.error(`useCallingExpWithCallingStateEffect: Error toggling mic in calling exp: ${activeCallCid}`, error);
107
+ }
108
+ });
109
+ return () => {
110
+ subscription.remove();
111
+ };
112
+ }, [activeCallCid, microphone]);
113
+ };
114
+ //# sourceMappingURL=useCallingExpWithCallingStateEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["videoLoggerSystem","useCall","useCallStateHooks","useEffect","useMemo","getCallDisplayName","getCallingxLibIfAvailable","logger","getLogger","useCallingExpWithCallingStateEffect","useMicrophoneState","useParticipants","useCallMembers","activeCall","isMute","microphone","callMembers","participants","activeCallCid","cid","currentUserId","callDisplayName","callingx","isSetup","isCallTracked","debug","endCallWithReason","catch","error","updateDisplay","setMutedCall","subscription","addEventListener","event","callId","muted","isCurrentlyMuted","state","status","disable","enable","remove"],"sourceRoot":"../../../../src","sources":["hooks/push/useCallingExpWithCallingStateEffect.ts"],"mappings":"AAAA,SA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AAC","ignoreList":[]}
@@ -1,11 +1,11 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import { getVoipPushNotificationLib } from '../../utils/push/libs';
3
2
  import { Platform } from 'react-native';
4
3
  import { StreamVideoRN } from '../../utils';
5
4
  import { onVoipNotificationReceived } from '../../utils/push/internal/ios';
6
5
  import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
7
6
  import { setPushLogoutCallback } from '../../utils/internal/pushLogoutCallback';
8
7
  import { videoLoggerSystem } from '@stream-io/video-client';
8
+ import { getCallingxLibIfAvailable } from '../../utils/push/libs';
9
9
  const logger = videoLoggerSystem.getLogger('useIosVoipPushEventsSetupEffect');
10
10
 
11
11
  /* VoipPushNotificationLib has support for only one listener type at a time
@@ -23,6 +23,7 @@ function setLogoutCallback(client, token, lastVoipTokenRef) {
23
23
  };
24
24
  try {
25
25
  await client.removeDevice(token);
26
+ logger.debug('PushLogoutCallback - Removed voip token', token);
26
27
  } catch (err) {
27
28
  logger.warn('PushLogoutCallback - Failed to remove voip token', err);
28
29
  }
@@ -77,20 +78,10 @@ export const useIosVoipPushEventsSetupEffect = () => {
77
78
  useEffect(() => {
78
79
  const pushConfig = StreamVideoRN.getConfig().push;
79
80
  const pushProviderName = pushConfig?.ios.pushProviderName;
80
- if (Platform.OS !== 'ios' || !client || !pushProviderName) {
81
+ const callingx = getCallingxLibIfAvailable();
82
+ if (Platform.OS !== 'ios' || !client || !pushProviderName || !callingx) {
81
83
  return;
82
84
  }
83
- if (!pushConfig.android.incomingCallChannel) {
84
- // TODO: remove this check and find a better way once we have telecom integration for android
85
- logger.debug('android incomingCallChannel is not defined, so skipping the useIosVoipPushEventsSetupEffect');
86
- return;
87
- }
88
- const voipPushNotification = getVoipPushNotificationLib();
89
-
90
- // even though we do this natively, we have to still register here again
91
- // natively this will make sure "register" event for JS is sent with the last push token
92
- // Necessary if client changed before we got the event here or user logged out and logged in again
93
- voipPushNotification.registerVoipToken();
94
85
  const onTokenReceived = token => {
95
86
  const userId = client.streamClient._user?.id ?? '';
96
87
  if (client.streamClient.anonymous || !token || !userId) {
@@ -118,27 +109,24 @@ export const useIosVoipPushEventsSetupEffect = () => {
118
109
  });
119
110
  };
120
111
  // fired when PushKit give us the latest token
121
- voipPushNotification.addEventListener('register', token => {
112
+ const voipRegisterListener = callingx.addEventListener('voipNotificationsRegistered', ({
113
+ token
114
+ }) => {
122
115
  onTokenReceived(token);
123
116
  });
124
117
 
125
- // this will fire when there are events occured before js bridge initialized
126
- voipPushNotification.addEventListener('didLoadWithEvents', events => {
127
- if (!events || !Array.isArray(events) || events.length < 1) {
128
- return;
129
- }
130
- for (const voipPushEvent of events) {
131
- const {
132
- name,
133
- data
134
- } = voipPushEvent;
135
- if (name === 'RNVoipPushRemoteNotificationsRegisteredEvent') {
136
- onTokenReceived(data);
137
- } else if (name === 'RNVoipPushRemoteNotificationReceivedEvent') {
138
- onVoipNotificationReceived(data, pushConfig);
139
- }
118
+ // this will return events that were fired before js bridge initialized
119
+ callingx.getInitialVoipEvents().forEach(({
120
+ eventName,
121
+ params
122
+ }) => {
123
+ if (eventName === 'voipNotificationsRegistered' && 'token' in params) {
124
+ onTokenReceived(params.token);
125
+ } else if (eventName === 'voipNotificationReceived') {
126
+ onVoipNotificationReceived(params, pushConfig);
140
127
  }
141
128
  });
129
+ callingx.registerVoipToken();
142
130
  lastListener.count += 1;
143
131
  const currentListenerCount = lastListener.count;
144
132
  return () => {
@@ -148,8 +136,7 @@ export const useIosVoipPushEventsSetupEffect = () => {
148
136
  return;
149
137
  }
150
138
  logger.debug(`Voip event listeners are removed for user: ${userId}`);
151
- voipPushNotification.removeEventListener('didLoadWithEvents');
152
- voipPushNotification.removeEventListener('register');
139
+ voipRegisterListener.remove();
153
140
  };
154
141
  }, [client]);
155
142
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","useState","getVoipPushNotificationLib","Platform","StreamVideoRN","onVoipNotificationReceived","useConnectedUser","useStreamVideoClient","setPushLogoutCallback","videoLoggerSystem","logger","getLogger","lastListener","count","setLogoutCallback","client","token","lastVoipTokenRef","current","userId","removeDevice","err","warn","useIosVoipPushEventsSetupEffect","connectedUserId","id","unsentToken","setUnsentToken","pushProviderName","getConfig","push","ios","tokenToSend","debug","addVoipDevice","then","undefined","catch","error","pushConfig","OS","android","incomingCallChannel","voipPushNotification","registerVoipToken","onTokenReceived","streamClient","_user","anonymous","reason","lastVoipToken","addEventListener","events","Array","isArray","length","voipPushEvent","name","data","currentListenerCount","removeEventListener"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosVoipPushEventsSetupEffect.ts"],"mappings":"AAAA,SAAgCA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1E,SAASC,0BAA0B,QAAQ,uBAAuB;AAElE,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,SACEC,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAA4BC,iBAAiB,QAAQ,yBAAyB;AAE9E,MAAMC,MAAM,GAAGD,iBAAiB,CAACE,SAAS,CAAC,iCAAiC,CAAC;;AAE7E;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAG;EAAEC,KAAK,EAAE;AAAE,CAAC;AAEjC,SAASC,iBAAiBA,CACxBC,MAAyB,EACzBC,KAAa,EACbC,gBAAqE,EACrE;EACAT,qBAAqB,CAAC,YAAY;IAChCS,gBAAgB,CAACC,OAAO,GAAG;MAAEF,KAAK,EAAE,EAAE;MAAEG,MAAM,EAAE;IAAG,CAAC;IACpD,IAAI;MACF,MAAMJ,MAAM,CAACK,YAAY,CAACJ,KAAK,CAAC;IAClC,CAAC,CAAC,OAAOK,GAAG,EAAE;MACZX,MAAM,CAACY,IAAI,CAAC,kDAAkD,EAAED,GAAG,CAAC;IACtE;EACF,CAAC,CAAC;AACJ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CAA2C,EAAE;UAC/DpD,0BAA0B,CAACqD,IAAI,EAAEnB,UAAU,CAAC;QAC9C;MACF;IACF,CAAC,CAAC;IACF3B,YAAY,CAACC,KAAK,IAAI,CAAC;IACvB,MAAM8C,oBAAoB,GAAG/C,YAAY,CAACC,KAAK;IAE/C,OAAO,MAAM;MACX,MAAMM,MAAM,GAAGJ,MAAM,CAAC+B,YAAY,CAACC,KAAK,EAAEtB,EAAE;MAC5C,IAAIkC,oBAAoB,KAAK/C,YAAY,CAACC,KAAK,EAAE;QAC/CH,MAAM,CAACuB,KAAK,CACV,mDAAmDd,MAAM,EAC3D,CAAC;QACD;MACF;MACAT,MAAM,CAACuB,KAAK,CAAC,8CAA8Cd,MAAM,EAAE,CAAC;MACpEwB,oBAAoB,CAACiB,mBAAmB,CAAC,mBAAmB,CAAC;MAC7DjB,oBAAoB,CAACiB,mBAAmB,CAAC,UAAU,CAAC;IACtD,CAAC;EACH,CAAC,EAAE,CAAC7C,MAAM,CAAC,CAAC;AACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","useState","Platform","StreamVideoRN","onVoipNotificationReceived","useConnectedUser","useStreamVideoClient","setPushLogoutCallback","videoLoggerSystem","getCallingxLibIfAvailable","logger","getLogger","lastListener","count","setLogoutCallback","client","token","lastVoipTokenRef","current","userId","removeDevice","debug","err","warn","useIosVoipPushEventsSetupEffect","connectedUserId","id","unsentToken","setUnsentToken","pushProviderName","getConfig","push","ios","tokenToSend","addVoipDevice","then","undefined","catch","error","pushConfig","callingx","OS","onTokenReceived","streamClient","_user","anonymous","reason","lastVoipToken","voipRegisterListener","addEventListener","getInitialVoipEvents","forEach","eventName","params","registerVoipToken","currentListenerCount","remove"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosVoipPushEventsSetupEffect.ts"],"mappings":"AAAA,SAAgCA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1E,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,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BN,MAAM,CAACa,IAAI,CACT,8BAA8BP,KAAK,YAAYG,MAAM,EAAE,EACvDG,GACF,CAAC;MACH,CAAC,CAAC;IACN,CAAC;IACD;IACA,MAAM0B,oBAAoB,GAAGR,QAAQ,CAACS,gBAAgB,CACpD,6BAA6B,EAC7B,CAAC;MAAEjC;IAAM,CAAC,KAAK;MACb0B,eAAe,CAAC1B,KAAK,CAAC;IACxB,CACF,CAAC;;IAED;IACAwB,QAAQ,CAACU,oBAAoB,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;MAAEC,SAAS;MAAEC;IAAO,CAAC,KAAK;MACjE,IAAID,SAAS,KAAK,6BAA6B,IAAI,OAAO,IAAIC,MAAM,EAAE;QACpEX,eAAe,CAACW,MAAM,CAACrC,KAAK,CAAC;MAC/B,CAAC,MAAM,IAAIoC,SAAS,KAAK,0BAA0B,EAAE;QACnDhD,0BAA0B,CAACiD,MAAM,EAAEd,UAAU,CAAC;MAChD;IACF,CAAC,CAAC;IAEFC,QAAQ,CAACc,iBAAiB,CAAC,CAAC;IAE5B1C,YAAY,CAACC,KAAK,IAAI,CAAC;IACvB,MAAM0C,oBAAoB,GAAG3C,YAAY,CAACC,KAAK;IAE/C,OAAO,MAAM;MACX,MAAMM,MAAM,GAAGJ,MAAM,CAAC4B,YAAY,CAACC,KAAK,EAAElB,EAAE;MAC5C,IAAI6B,oBAAoB,KAAK3C,YAAY,CAACC,KAAK,EAAE;QAC/CH,MAAM,CAACW,KAAK,CACV,mDAAmDF,MAAM,EAC3D,CAAC;QACD;MACF;MACAT,MAAM,CAACW,KAAK,CAAC,8CAA8CF,MAAM,EAAE,CAAC;MACpE6B,oBAAoB,CAACQ,MAAM,CAAC,CAAC;IAC/B,CAAC;EACH,CAAC,EAAE,CAACzC,MAAM,CAAC,CAAC;AACd,CAAC","ignoreList":[]}
@@ -1,93 +1,58 @@
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, Platform } from 'react-native';
4
+ import { AppState, NativeModules, PermissionsAndroid, Platform } from 'react-native';
5
5
  import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
6
- import { getKeepCallAliveForegroundServiceTypes, getNotifeeLibNoThrowForKeepCallAlive } from '../utils/push/libs/notifee';
6
+ import { keepCallAliveCallRef } from '../utils/keepCallAliveHeadlessTask';
7
+ import { getNotifeeLibNoThrowForKeepCallAlive } from '../utils/push/libs/notifee';
8
+ import { getCallingxLibIfAvailable } from '../utils/push/libs';
7
9
  const notifeeLib = getNotifeeLibNoThrowForKeepCallAlive();
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
- });
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
+ }
41
17
  }
42
18
  async function startForegroundService(call_cid) {
43
- const isCallAliveConfigured = await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
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
+ })();
44
28
  if (!isCallAliveConfigured) {
45
- const logger = videoLoggerSystem.getLogger('startForegroundService');
46
29
  logger.info('KeepCallAlive is not configured. Skipping foreground service setup.');
47
30
  return;
48
31
  }
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');
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) {
54
35
  logger.info('Notification permission not granted, can not start foreground service to keep the call alive');
55
36
  return;
56
37
  }
57
38
  const videoConfig = StreamVideoRN.getConfig();
58
39
  const foregroundServiceConfig = videoConfig.foregroundService;
59
40
  const notificationTexts = foregroundServiceConfig.android.notificationTexts;
60
- const channelId = foregroundServiceConfig.android.channel.id;
61
- await notifeeLib.default.createChannel(foregroundServiceConfig.android.channel);
62
- const foregroundServiceTypes = await getKeepCallAliveForegroundServiceTypes();
41
+ const channel = foregroundServiceConfig.android.channel;
42
+ const smallIconName = videoConfig.push?.android.smallIcon;
43
+
63
44
  // NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
64
45
  // this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
65
46
  // this crash was reproducible only in some android devices
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
- });
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
+ }
85
53
  });
86
54
  }
87
55
 
88
- // flag to check if setForegroundService has already been run once
89
- let isSetForegroundServiceRan = false;
90
-
91
56
  /**
92
57
  * This hook is used to keep the call alive in the background for Android.
93
58
  * It starts a foreground service to keep the call alive as soon as the call is joined
@@ -97,7 +62,7 @@ let isSetForegroundServiceRan = false;
97
62
  export const useAndroidKeepCallAliveEffect = () => {
98
63
  const foregroundServiceStartedRef = useRef(false);
99
64
  const call = useCall();
100
- callToPassToForegroundService.current = call;
65
+ keepCallAliveCallRef.current = call;
101
66
  const activeCallCid = call?.cid;
102
67
  const {
103
68
  useCallCallingState
@@ -105,12 +70,16 @@ export const useAndroidKeepCallAliveEffect = () => {
105
70
  const callingState = useCallCallingState();
106
71
  const isOutgoingCall = callingState === CallingState.RINGING && call?.isCreatedByMe;
107
72
  const isCallJoined = callingState === CallingState.JOINED;
73
+ const isRingingCall = call?.ringing;
108
74
  const shouldStartForegroundService = !foregroundServiceStartedRef.current && (isOutgoingCall || isCallJoined);
109
75
  useEffect(() => {
110
76
  if (Platform.OS === 'ios' || !activeCallCid) {
111
77
  return undefined;
112
78
  }
113
- if (!notifeeLib) return undefined;
79
+ const callingx = getCallingxLibIfAvailable();
80
+ if (callingx?.isSetup && (isRingingCall || !isRingingCall && callingx?.isOngoingCallsEnabled)) {
81
+ return undefined;
82
+ }
114
83
 
115
84
  // start foreground service as soon as the call is joined
116
85
  if (shouldStartForegroundService) {
@@ -118,21 +87,18 @@ export const useAndroidKeepCallAliveEffect = () => {
118
87
  if (foregroundServiceStartedRef.current) {
119
88
  return;
120
89
  }
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);
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
+ }
133
101
  }
134
- // check for notification permission and then start the foreground service
135
-
136
102
  await startForegroundService(activeCallCid);
137
103
  foregroundServiceStartedRef.current = true;
138
104
  };
@@ -140,7 +106,6 @@ export const useAndroidKeepCallAliveEffect = () => {
140
106
  // ensure that app is active before running the function
141
107
  if (AppState.currentState === 'active') {
142
108
  run();
143
- return undefined;
144
109
  }
145
110
  const sub = AppState.addEventListener('change', nextAppState => {
146
111
  if (nextAppState === 'active') {
@@ -155,34 +120,36 @@ export const useAndroidKeepCallAliveEffect = () => {
155
120
  return () => {
156
121
  // cancel any notifee displayed notification when the call has transitioned out of ringing
157
122
  // NOTE: cancels only the non fg service notifications
158
- notifeeLib.default.cancelDisplayedNotification(activeCallCid);
123
+ if (notifeeLib) {
124
+ notifeeLib.default.cancelDisplayedNotification(activeCallCid);
125
+ }
159
126
  };
160
127
  } else if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
161
128
  if (foregroundServiceStartedRef.current) {
162
- callToPassToForegroundService.current = undefined;
129
+ keepCallAliveCallRef.current = undefined;
163
130
  // stop foreground service when the call is not active
164
- notifeeLib.default.stopForegroundService();
131
+ stopForegroundServiceNoThrow();
165
132
  foregroundServiceStartedRef.current = false;
166
133
  } else {
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
- });
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
+ }
175
143
  }
176
144
  }
177
145
  return undefined;
178
- }, [activeCallCid, callingState, shouldStartForegroundService]);
146
+ }, [activeCallCid, callingState, shouldStartForegroundService, isRingingCall]);
179
147
  useEffect(() => {
180
148
  return () => {
181
149
  // stop foreground service when this effect is unmounted
182
150
  if (foregroundServiceStartedRef.current) {
183
- if (!notifeeLib) return;
184
- callToPassToForegroundService.current = undefined;
185
- notifeeLib.default.stopForegroundService();
151
+ keepCallAliveCallRef.current = undefined;
152
+ stopForegroundServiceNoThrow();
186
153
  foregroundServiceStartedRef.current = false;
187
154
  }
188
155
  };
@@ -1 +1 @@
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,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,CAACC,OAAO,GAAGC,SAAS;QACjD;QACAH,UAAU,CAACa,OAAO,CAACyD,qBAAqB,CAAC,CAAC;QAC1ClB,2BAA2B,CAAClD,OAAO,GAAG,KAAK;MAC7C,CAAC,MAAM;QACLF,UAAU,CAACa,OAAO,CACfqD,yBAAyB,CAAC,CAAC,CAC3B1D,IAAI,CAAEyD,sBAAsB,IAAK;UAChC,MAAME,sBAAsB,GAAGF,sBAAsB,CAACG,IAAI,CACvDC,YAAY,IAAKA,YAAY,CAACjC,EAAE,KAAKiB,aACxC,CAAC;UACD,IAAIc,sBAAsB,EAAE;YAC1BlE,6BAA6B,CAACC,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":[]}
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;EACtD,MAAMP,MAAM,GAAGN,iBAAiB,CAACO,SAAS,CAAC,w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,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":[]}
@@ -9,6 +9,7 @@ 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';
12
13
 
13
14
  // We're registering globals, because our video JS client is serving SDKs that use browser based webRTC functions.
14
15
  // 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;;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
+ {"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":[]}