@stream-io/video-react-native-sdk 1.29.4-beta.0 → 1.30.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.
- package/CHANGELOG.md +3162 -0
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/AndroidManifestNew.xml +0 -11
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
- package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +13 -7
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +50 -14
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +12 -9
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +19 -4
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +2 -0
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/index.js +6 -6
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/hooks/index.js +0 -11
- package/dist/commonjs/utils/hooks/index.js.map +1 -1
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +202 -151
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +34 -17
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +20 -32
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
- package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +19 -8
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +10 -4
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +52 -16
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +15 -12
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +20 -5
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/module/hooks/push/index.js +2 -0
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +0 -26
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/providers/StreamCall/index.js +6 -6
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +21 -33
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/hooks/index.js +0 -1
- package/dist/module/utils/hooks/index.js.map +1 -1
- package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +204 -153
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +34 -17
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +44 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +19 -29
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/callkeep.js +11 -0
- package/dist/module/utils/push/libs/callkeep.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +2 -1
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +18 -0
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
- package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +18 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +0 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/hooks/index.d.ts +0 -1
- package/dist/typescript/utils/hooks/index.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +2 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +2 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/index.d.ts +2 -1
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
- package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
- package/expo-config-plugin/dist/withAppDelegate.js +197 -19
- package/expo-config-plugin/dist/withMainActivity.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
- package/ios/PictureInPicture/PictureInPictureAvatarView.swift +273 -0
- package/ios/PictureInPicture/PictureInPictureConnectionQualityIndicator.swift +162 -0
- package/ios/PictureInPicture/PictureInPictureContent.swift +173 -0
- package/ios/PictureInPicture/PictureInPictureContentState.swift +123 -0
- package/ios/PictureInPicture/PictureInPictureDelegateProxy.swift +89 -0
- package/ios/PictureInPicture/PictureInPictureEnforcedStopAdapter.swift +166 -0
- package/ios/PictureInPicture/PictureInPictureLogger.swift +16 -0
- package/ios/PictureInPicture/PictureInPictureParticipantOverlayView.swift +217 -0
- package/ios/PictureInPicture/PictureInPictureReconnectionView.swift +193 -0
- package/ios/PictureInPicture/StreamAVPictureInPictureVideoCallViewController.swift +125 -7
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +237 -63
- package/ios/PictureInPicture/StreamPictureInPictureControllerProtocol.swift +30 -0
- package/ios/PictureInPicture/StreamPictureInPictureVideoRenderer.swift +384 -12
- package/ios/RTCViewPip.swift +187 -21
- package/ios/RTCViewPipManager.mm +9 -0
- package/ios/RTCViewPipManager.swift +3 -3
- package/ios/StreamInCallManager.m +0 -2
- package/ios/StreamInCallManager.swift +7 -19
- package/ios/StreamVideoReactNative.h +4 -7
- package/ios/StreamVideoReactNative.m +82 -189
- package/package.json +19 -14
- package/src/components/Call/CallContent/CallContent.tsx +16 -8
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +81 -15
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +36 -0
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +28 -14
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +19 -10
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +20 -5
- package/src/hooks/push/index.ts +2 -0
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
- package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
- package/src/index.ts +0 -1
- package/src/modules/call-manager/CallManager.ts +0 -36
- package/src/modules/call-manager/native-module.d.ts +0 -7
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +30 -40
- package/src/utils/StreamVideoRN/types.ts +29 -56
- package/src/utils/hooks/index.ts +0 -1
- package/src/utils/internal/registerSDKGlobals.ts +4 -47
- package/src/utils/push/android.ts +309 -227
- package/src/utils/push/internal/ios.ts +44 -28
- package/src/utils/push/internal/rxSubjects.ts +61 -0
- package/src/utils/push/internal/utils.ts +26 -45
- package/src/utils/push/ios.ts +6 -1
- package/src/utils/push/libs/callkeep.ts +16 -0
- package/src/utils/push/libs/index.ts +2 -1
- package/src/utils/push/libs/notifee/index.ts +27 -0
- package/src/utils/push/libs/voipPushNotification.ts +17 -0
- package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
- package/src/version.ts +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/utils/hooks/useDebouncedValue.js +0 -24
- package/dist/commonjs/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callingx.js +0 -75
- package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/module/utils/hooks/useDebouncedValue.js +0 -19
- package/dist/module/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/module/utils/internal/callingx/callingx.js +0 -100
- package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/module/utils/push/libs/callingx.js +0 -67
- package/dist/module/utils/push/libs/callingx.js.map +0 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
- package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts +0 -8
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -14
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
- package/src/utils/hooks/useDebouncedValue.ts +0 -21
- package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
- package/src/utils/internal/callingx/callingx.ts +0 -146
- package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
- package/src/utils/push/libs/callingx.ts +0 -90
- package/src/utils/push/setupCallingExpEvents.ts +0 -130
|
@@ -5,48 +5,76 @@ import {
|
|
|
5
5
|
AppState,
|
|
6
6
|
type AppStateStatus,
|
|
7
7
|
NativeModules,
|
|
8
|
-
PermissionsAndroid,
|
|
9
8
|
Platform,
|
|
10
9
|
} from 'react-native';
|
|
11
|
-
import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { Call, CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
11
|
+
import {
|
|
12
|
+
getKeepCallAliveForegroundServiceTypes,
|
|
13
|
+
getNotifeeLibNoThrowForKeepCallAlive,
|
|
14
|
+
} from '../utils/push/libs/notifee';
|
|
15
15
|
|
|
16
16
|
const notifeeLib = getNotifeeLibNoThrowForKeepCallAlive();
|
|
17
|
+
const callToPassToForegroundService: { current: Call | undefined } = {
|
|
18
|
+
current: undefined,
|
|
19
|
+
};
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function setForegroundService() {
|
|
22
|
+
if (Platform.OS === 'ios' || !notifeeLib) return;
|
|
23
|
+
NativeModules.StreamVideoReactNative.isCallAliveConfigured().then(
|
|
24
|
+
(isConfigured: boolean) => {
|
|
25
|
+
if (!isConfigured) {
|
|
26
|
+
const logger = videoLoggerSystem.getLogger(
|
|
27
|
+
'setForegroundService method',
|
|
28
|
+
);
|
|
29
|
+
logger.info(
|
|
30
|
+
'KeepCallAlive is not configured. Skipping foreground service setup.',
|
|
31
|
+
);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
notifeeLib.default.registerForegroundService(() => {
|
|
35
|
+
const task = new Promise((resolve) => {
|
|
36
|
+
const logger = videoLoggerSystem.getLogger(
|
|
37
|
+
'setForegroundService method',
|
|
38
|
+
);
|
|
39
|
+
logger.info('Foreground service running for call in progress');
|
|
40
|
+
// any task to run from SDK in the foreground service must be added
|
|
41
|
+
resolve(true);
|
|
42
|
+
});
|
|
43
|
+
const videoConfig = StreamVideoRN.getConfig();
|
|
44
|
+
const foregroundServiceConfig = videoConfig.foregroundService;
|
|
45
|
+
const { taskToRun } = foregroundServiceConfig.android;
|
|
46
|
+
const call = callToPassToForegroundService.current;
|
|
47
|
+
if (!call) {
|
|
48
|
+
const logger = videoLoggerSystem.getLogger(
|
|
49
|
+
'setForegroundService method',
|
|
50
|
+
);
|
|
51
|
+
logger.warn('No call to pass to foreground service');
|
|
52
|
+
return task.then(() => new Promise(() => {}));
|
|
53
|
+
}
|
|
54
|
+
callToPassToForegroundService.current = undefined;
|
|
55
|
+
return task.then(() => taskToRun(call));
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
);
|
|
25
59
|
}
|
|
26
60
|
|
|
27
61
|
async function startForegroundService(call_cid: string) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
return await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
|
|
32
|
-
} catch (e) {
|
|
33
|
-
logger.warn('Failed to check whether KeepCallAlive is configured', e);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
})();
|
|
62
|
+
const isCallAliveConfigured =
|
|
63
|
+
await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
|
|
37
64
|
if (!isCallAliveConfigured) {
|
|
65
|
+
const logger = videoLoggerSystem.getLogger('startForegroundService');
|
|
38
66
|
logger.info(
|
|
39
67
|
'KeepCallAlive is not configured. Skipping foreground service setup.',
|
|
40
68
|
);
|
|
41
69
|
return;
|
|
42
70
|
}
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
// check for notification permission and then start the foreground service
|
|
72
|
+
if (!notifeeLib) return;
|
|
73
|
+
const settings = await notifeeLib.default.getNotificationSettings();
|
|
74
|
+
if (
|
|
75
|
+
settings.authorizationStatus !== notifeeLib.AuthorizationStatus.AUTHORIZED
|
|
76
|
+
) {
|
|
77
|
+
const logger = videoLoggerSystem.getLogger('startForegroundService');
|
|
50
78
|
logger.info(
|
|
51
79
|
'Notification permission not granted, can not start foreground service to keep the call alive',
|
|
52
80
|
);
|
|
@@ -55,28 +83,38 @@ async function startForegroundService(call_cid: string) {
|
|
|
55
83
|
const videoConfig = StreamVideoRN.getConfig();
|
|
56
84
|
const foregroundServiceConfig = videoConfig.foregroundService;
|
|
57
85
|
const notificationTexts = foregroundServiceConfig.android.notificationTexts;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
86
|
+
const channelId = foregroundServiceConfig.android.channel.id;
|
|
87
|
+
await notifeeLib.default.createChannel(
|
|
88
|
+
foregroundServiceConfig.android.channel,
|
|
89
|
+
);
|
|
90
|
+
const foregroundServiceTypes = await getKeepCallAliveForegroundServiceTypes();
|
|
61
91
|
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
62
92
|
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
63
93
|
// this crash was reproducible only in some android devices
|
|
64
|
-
requestAnimationFrame(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
requestAnimationFrame(() => {
|
|
95
|
+
notifeeLib.default.displayNotification({
|
|
96
|
+
id: call_cid,
|
|
97
|
+
title: notificationTexts.title,
|
|
98
|
+
body: notificationTexts.body,
|
|
99
|
+
android: {
|
|
100
|
+
channelId,
|
|
101
|
+
smallIcon: videoConfig.push?.android.smallIcon,
|
|
102
|
+
foregroundServiceTypes,
|
|
103
|
+
asForegroundService: true,
|
|
104
|
+
ongoing: true, // user cannot dismiss the notification
|
|
105
|
+
colorized: true,
|
|
106
|
+
pressAction: {
|
|
107
|
+
id: 'default',
|
|
108
|
+
launchActivity: 'default', // open the app when the notification is pressed
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
});
|
|
77
112
|
});
|
|
78
113
|
}
|
|
79
114
|
|
|
115
|
+
// flag to check if setForegroundService has already been run once
|
|
116
|
+
let isSetForegroundServiceRan = false;
|
|
117
|
+
|
|
80
118
|
/**
|
|
81
119
|
* This hook is used to keep the call alive in the background for Android.
|
|
82
120
|
* It starts a foreground service to keep the call alive as soon as the call is joined
|
|
@@ -87,7 +125,7 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
87
125
|
const foregroundServiceStartedRef = useRef(false);
|
|
88
126
|
|
|
89
127
|
const call = useCall();
|
|
90
|
-
|
|
128
|
+
callToPassToForegroundService.current = call;
|
|
91
129
|
const activeCallCid = call?.cid;
|
|
92
130
|
const { useCallCallingState } = useCallStateHooks();
|
|
93
131
|
const callingState = useCallCallingState();
|
|
@@ -95,7 +133,6 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
95
133
|
const isOutgoingCall =
|
|
96
134
|
callingState === CallingState.RINGING && call?.isCreatedByMe;
|
|
97
135
|
const isCallJoined = callingState === CallingState.JOINED;
|
|
98
|
-
const isRingingCall = call?.ringing;
|
|
99
136
|
|
|
100
137
|
const shouldStartForegroundService =
|
|
101
138
|
!foregroundServiceStartedRef.current && (isOutgoingCall || isCallJoined);
|
|
@@ -104,14 +141,7 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
104
141
|
if (Platform.OS === 'ios' || !activeCallCid) {
|
|
105
142
|
return undefined;
|
|
106
143
|
}
|
|
107
|
-
|
|
108
|
-
const callingx = getCallingxLibIfAvailable();
|
|
109
|
-
if (
|
|
110
|
-
callingx?.isSetup &&
|
|
111
|
-
(isRingingCall || (!isRingingCall && callingx?.isOngoingCallsEnabled))
|
|
112
|
-
) {
|
|
113
|
-
return undefined;
|
|
114
|
-
}
|
|
144
|
+
if (!notifeeLib) return undefined;
|
|
115
145
|
|
|
116
146
|
// start foreground service as soon as the call is joined
|
|
117
147
|
if (shouldStartForegroundService) {
|
|
@@ -119,21 +149,23 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
119
149
|
if (foregroundServiceStartedRef.current) {
|
|
120
150
|
return;
|
|
121
151
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
if (!isSetForegroundServiceRan) {
|
|
153
|
+
isSetForegroundServiceRan = true;
|
|
154
|
+
setForegroundService();
|
|
155
|
+
}
|
|
156
|
+
const notifee = notifeeLib.default;
|
|
157
|
+
const displayedNotifications =
|
|
158
|
+
await notifee.getDisplayedNotifications();
|
|
159
|
+
const activeCallNotification = displayedNotifications.find(
|
|
160
|
+
(notification) => notification.id === activeCallCid,
|
|
161
|
+
);
|
|
162
|
+
if (activeCallNotification) {
|
|
163
|
+
callToPassToForegroundService.current = undefined;
|
|
164
|
+
// this means that we have a incoming call notification shown as foreground service and we must stop it
|
|
165
|
+
notifee.stopForegroundService();
|
|
166
|
+
notifee.cancelDisplayedNotification(activeCallCid);
|
|
136
167
|
}
|
|
168
|
+
// check for notification permission and then start the foreground service
|
|
137
169
|
|
|
138
170
|
await startForegroundService(activeCallCid);
|
|
139
171
|
foregroundServiceStartedRef.current = true;
|
|
@@ -142,6 +174,7 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
142
174
|
// ensure that app is active before running the function
|
|
143
175
|
if (AppState.currentState === 'active') {
|
|
144
176
|
run();
|
|
177
|
+
return undefined;
|
|
145
178
|
}
|
|
146
179
|
const sub = AppState.addEventListener(
|
|
147
180
|
'change',
|
|
@@ -159,49 +192,42 @@ export const useAndroidKeepCallAliveEffect = () => {
|
|
|
159
192
|
return () => {
|
|
160
193
|
// cancel any notifee displayed notification when the call has transitioned out of ringing
|
|
161
194
|
// NOTE: cancels only the non fg service notifications
|
|
162
|
-
|
|
163
|
-
notifeeLib.default.cancelDisplayedNotification(activeCallCid);
|
|
164
|
-
}
|
|
195
|
+
notifeeLib.default.cancelDisplayedNotification(activeCallCid);
|
|
165
196
|
};
|
|
166
197
|
} else if (
|
|
167
198
|
callingState === CallingState.IDLE ||
|
|
168
199
|
callingState === CallingState.LEFT
|
|
169
200
|
) {
|
|
170
201
|
if (foregroundServiceStartedRef.current) {
|
|
171
|
-
|
|
202
|
+
callToPassToForegroundService.current = undefined;
|
|
172
203
|
// stop foreground service when the call is not active
|
|
173
|
-
|
|
204
|
+
notifeeLib.default.stopForegroundService();
|
|
174
205
|
foregroundServiceStartedRef.current = false;
|
|
175
206
|
} else {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
207
|
+
notifeeLib.default
|
|
208
|
+
.getDisplayedNotifications()
|
|
209
|
+
.then((displayedNotifications) => {
|
|
210
|
+
const activeCallNotification = displayedNotifications.find(
|
|
211
|
+
(notification) => notification.id === activeCallCid,
|
|
212
|
+
);
|
|
213
|
+
if (activeCallNotification) {
|
|
214
|
+
callToPassToForegroundService.current = undefined;
|
|
215
|
+
// this means that we have a incoming call notification shown as foreground service and we must stop it
|
|
216
|
+
notifeeLib.default.stopForegroundService();
|
|
217
|
+
}
|
|
218
|
+
});
|
|
189
219
|
}
|
|
190
220
|
}
|
|
191
221
|
return undefined;
|
|
192
|
-
}, [
|
|
193
|
-
activeCallCid,
|
|
194
|
-
callingState,
|
|
195
|
-
shouldStartForegroundService,
|
|
196
|
-
isRingingCall,
|
|
197
|
-
]);
|
|
222
|
+
}, [activeCallCid, callingState, shouldStartForegroundService]);
|
|
198
223
|
|
|
199
224
|
useEffect(() => {
|
|
200
225
|
return () => {
|
|
201
226
|
// stop foreground service when this effect is unmounted
|
|
202
227
|
if (foregroundServiceStartedRef.current) {
|
|
203
|
-
|
|
204
|
-
|
|
228
|
+
if (!notifeeLib) return;
|
|
229
|
+
callToPassToForegroundService.current = undefined;
|
|
230
|
+
notifeeLib.default.stopForegroundService();
|
|
205
231
|
foregroundServiceStartedRef.current = false;
|
|
206
232
|
}
|
|
207
233
|
};
|
package/src/index.ts
CHANGED
|
@@ -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,10 +1,7 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
2
2
|
import { AudioDeviceStatus, StreamInCallManagerConfig } from './types';
|
|
3
|
-
import { getCallingxLibIfAvailable } from '../../utils/push/libs/callingx';
|
|
4
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
5
3
|
|
|
6
4
|
const NativeManager = NativeModules.StreamInCallManager;
|
|
7
|
-
const CallingxModule = getCallingxLibIfAvailable();
|
|
8
5
|
|
|
9
6
|
const invariant = (condition: boolean, message: string) => {
|
|
10
7
|
if (!condition) throw new Error(message);
|
|
@@ -75,19 +72,6 @@ class SpeakerManager {
|
|
|
75
72
|
};
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
const shouldBypassForCallKit = (): boolean => {
|
|
79
|
-
if (Platform.OS !== 'ios') {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
if (!CallingxModule) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
return (
|
|
86
|
-
CallingxModule.isSetup &&
|
|
87
|
-
(CallingxModule.hasRegisteredCall() || CallingxModule.isOngoingCallsEnabled)
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
75
|
export class CallManager {
|
|
92
76
|
android = new AndroidCallManager();
|
|
93
77
|
ios = new IOSCallManager();
|
|
@@ -111,14 +95,6 @@ export class CallManager {
|
|
|
111
95
|
* @param config.enableStereoAudioOutput Whether to enable stereo audio output. Only supported for listener audio role.
|
|
112
96
|
*/
|
|
113
97
|
start = (config?: StreamInCallManagerConfig): void => {
|
|
114
|
-
if (shouldBypassForCallKit()) {
|
|
115
|
-
videoLoggerSystem
|
|
116
|
-
.getLogger('CallManager')
|
|
117
|
-
.debug(
|
|
118
|
-
'start: skipping start as callkit is handling the audio session',
|
|
119
|
-
);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
98
|
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
123
99
|
if (config?.audioRole === 'communicator') {
|
|
124
100
|
const type = config.deviceEndpointType ?? 'speaker';
|
|
@@ -134,12 +110,6 @@ export class CallManager {
|
|
|
134
110
|
* Stops the in call manager.
|
|
135
111
|
*/
|
|
136
112
|
stop = (): void => {
|
|
137
|
-
if (shouldBypassForCallKit()) {
|
|
138
|
-
videoLoggerSystem
|
|
139
|
-
.getLogger('CallManager')
|
|
140
|
-
.debug('stop: skipping stop as callkit is handling the audio session');
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
113
|
NativeManager.stop();
|
|
144
114
|
};
|
|
145
115
|
|
|
@@ -148,10 +118,4 @@ export class CallManager {
|
|
|
148
118
|
* in the native layer.
|
|
149
119
|
*/
|
|
150
120
|
logAudioState = (): void => NativeManager.logAudioState();
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* For debugging purposes, returns the current audio state as a string.
|
|
154
|
-
* @returns A string containing the current audio state information.
|
|
155
|
-
*/
|
|
156
|
-
getAudioStateLog = (): string => NativeManager.getAudioStateLog();
|
|
157
121
|
}
|
|
@@ -82,13 +82,6 @@ export interface CallManager extends NativeModule {
|
|
|
82
82
|
* Meant for debugging purposes.
|
|
83
83
|
*/
|
|
84
84
|
logAudioState: () => void;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get the current audio state as a string.
|
|
88
|
-
* Meant for debugging purposes.
|
|
89
|
-
* @returns A string containing the current audio state information.
|
|
90
|
-
*/
|
|
91
|
-
getAudioStateLog: () => string;
|
|
92
85
|
}
|
|
93
86
|
|
|
94
87
|
declare module 'react-native' {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { StreamCallProvider } from '@stream-io/video-react-bindings';
|
|
2
2
|
import React, { type PropsWithChildren, useEffect } from 'react';
|
|
3
3
|
import { Call } from '@stream-io/video-client';
|
|
4
|
+
import { useIosCallkeepWithCallingStateEffect } from '../../hooks/push/useIosCallkeepWithCallingStateEffect';
|
|
4
5
|
import { canAddPushWSSubscriptionsRef } from '../../utils/push/internal/utils';
|
|
5
6
|
import { useAndroidKeepCallAliveEffect } from '../../hooks/useAndroidKeepCallAliveEffect';
|
|
6
7
|
import { AppStateListener } from './AppStateListener';
|
|
7
8
|
import { DeviceStats } from './DeviceStats';
|
|
8
9
|
import { pushUnsubscriptionCallbacks } from '../../utils/push/internal/constants';
|
|
9
|
-
import { useCallingExpWithCallingStateEffect } from '../../hooks/push/useCallingExpWithCallingStateEffect';
|
|
10
10
|
|
|
11
11
|
// const PIP_CHANGE_EVENT = 'StreamVideoReactNative_PIP_CHANGE_EVENT';
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ export const StreamCall = ({
|
|
|
34
34
|
<StreamCallProvider call={call}>
|
|
35
35
|
<AppStateListener />
|
|
36
36
|
<AndroidKeepCallAlive />
|
|
37
|
-
<
|
|
37
|
+
<IosInformCallkeepCallEnd />
|
|
38
38
|
<ClearPushWSSubscriptions />
|
|
39
39
|
<DeviceStats />
|
|
40
40
|
{children}
|
|
@@ -52,11 +52,11 @@ const AndroidKeepCallAlive = () => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* This is a renderless component to
|
|
56
|
-
*
|
|
55
|
+
* This is a renderless component to end the call in callkeep for ios.
|
|
56
|
+
* useAndroidKeepCallAliveEffect needs to called inside a child of StreamCallProvider.
|
|
57
57
|
*/
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const IosInformCallkeepCallEnd = () => {
|
|
59
|
+
useIosCallkeepWithCallingStateEffect();
|
|
60
60
|
return null;
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -3,14 +3,9 @@ import pushLogoutCallbacks from '../internal/pushLogoutCallback';
|
|
|
3
3
|
import newNotificationCallbacks, {
|
|
4
4
|
type NewCallNotificationCallback,
|
|
5
5
|
} from '../internal/newNotificationCallbacks';
|
|
6
|
+
import { setupIosCallKeepEvents } from '../push/setupIosCallKeepEvents';
|
|
6
7
|
import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
|
|
7
|
-
import { setupCallingExpEvents } from '../push/setupCallingExpEvents';
|
|
8
|
-
import {
|
|
9
|
-
extractCallingExpOptions,
|
|
10
|
-
getCallingxLib,
|
|
11
|
-
} from '../push/libs/callingx';
|
|
12
8
|
import { NativeModules, Platform } from 'react-native';
|
|
13
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
14
9
|
|
|
15
10
|
// Utility type for deep partial
|
|
16
11
|
type DeepPartial<T> = {
|
|
@@ -52,7 +47,10 @@ const DEFAULT_STREAM_VIDEO_CONFIG: StreamVideoConfig = {
|
|
|
52
47
|
android: {
|
|
53
48
|
channel: {
|
|
54
49
|
id: 'stream_call_foreground_service',
|
|
55
|
-
name: '
|
|
50
|
+
name: 'To keep calls alive',
|
|
51
|
+
lights: false,
|
|
52
|
+
vibration: false,
|
|
53
|
+
importance: 3,
|
|
56
54
|
},
|
|
57
55
|
notificationTexts: {
|
|
58
56
|
title: 'Call in progress',
|
|
@@ -78,6 +76,20 @@ export class StreamVideoRN {
|
|
|
78
76
|
this.config = deepMerge(this.config, updateConfig);
|
|
79
77
|
}
|
|
80
78
|
|
|
79
|
+
static updateAndroidIncomingCallChannel(
|
|
80
|
+
updateChannel: Partial<
|
|
81
|
+
NonNullable<StreamVideoConfig['push']>['android']['incomingCallChannel']
|
|
82
|
+
>,
|
|
83
|
+
) {
|
|
84
|
+
const prevChannel = this.config.push?.android?.incomingCallChannel;
|
|
85
|
+
if (prevChannel) {
|
|
86
|
+
this.config.push!.android.incomingCallChannel = {
|
|
87
|
+
...prevChannel,
|
|
88
|
+
...updateChannel,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
/**
|
|
82
94
|
* Set the push config for StreamVideoRN.
|
|
83
95
|
* This method must be called **outside** of your application lifecycle, e.g. alongside your
|
|
@@ -90,26 +102,7 @@ export class StreamVideoRN {
|
|
|
90
102
|
* import App from './App';
|
|
91
103
|
* // Set push config
|
|
92
104
|
* const pushConfig = {}; // construct your config
|
|
93
|
-
*
|
|
94
|
-
* const callingExpOptions = {
|
|
95
|
-
* ios: {
|
|
96
|
-
* callsHistory: true,
|
|
97
|
-
* displayCallTimeout: 60000,
|
|
98
|
-
* sound: 'ringtone',
|
|
99
|
-
* imageName: 'callkit_icon',
|
|
100
|
-
* },
|
|
101
|
-
* android: {
|
|
102
|
-
* incomingChannel: {
|
|
103
|
-
* id: 'stream_incoming_call_notifications',
|
|
104
|
-
* name: 'Call notifications',
|
|
105
|
-
* vibration: true,
|
|
106
|
-
* sound: 'default',
|
|
107
|
-
* },
|
|
108
|
-
* titleTransformer: (text: string) => text,
|
|
109
|
-
* subtitleTransformer: (text: string) => text,
|
|
110
|
-
* },
|
|
111
|
-
* };
|
|
112
|
-
* StreamVideoRN.setPushConfig(pushConfig, callingExpOptions);
|
|
105
|
+
* StreamVideoRN.setPushConfig(pushConfig);
|
|
113
106
|
* AppRegistry.registerComponent('app', () => App);
|
|
114
107
|
*/
|
|
115
108
|
static setPushConfig(pushConfig: NonNullable<StreamVideoConfig['push']>) {
|
|
@@ -117,23 +110,20 @@ export class StreamVideoRN {
|
|
|
117
110
|
// Ignoring this config as push config was already set
|
|
118
111
|
return;
|
|
119
112
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const callingx = getCallingxLib();
|
|
125
|
-
videoLoggerSystem
|
|
126
|
-
.getLogger('StreamVideoRN.setPushConfig')
|
|
127
|
-
.info(JSON.stringify(this.config));
|
|
128
|
-
const options = extractCallingExpOptions(this.config);
|
|
129
|
-
callingx.setup(options);
|
|
130
|
-
} catch {
|
|
113
|
+
if (
|
|
114
|
+
__DEV__ &&
|
|
115
|
+
(pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)
|
|
116
|
+
) {
|
|
131
117
|
throw new Error(
|
|
132
|
-
|
|
118
|
+
`Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
|
|
119
|
+
Please watch for incoming and outgoing calls in the root component of your app.
|
|
120
|
+
Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`,
|
|
133
121
|
);
|
|
134
122
|
}
|
|
135
123
|
|
|
136
|
-
|
|
124
|
+
this.config.push = pushConfig;
|
|
125
|
+
|
|
126
|
+
setupIosCallKeepEvents(pushConfig);
|
|
137
127
|
setupIosVoipPushEvents(pushConfig);
|
|
138
128
|
}
|
|
139
129
|
|