@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
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { StreamVideoConfig } from '../../StreamVideoRN/types';
|
|
2
|
-
|
|
3
|
-
export type RNCallingxType =
|
|
4
|
-
import('@stream-io/react-native-callingx').ICallingxModule;
|
|
5
|
-
export type EventData = import('@stream-io/react-native-callingx').EventData;
|
|
6
|
-
export type EventParams =
|
|
7
|
-
import('@stream-io/react-native-callingx').EventParams;
|
|
8
|
-
export type CallingExpOptions =
|
|
9
|
-
import('@stream-io/react-native-callingx').CallingExpOptions;
|
|
10
|
-
|
|
11
|
-
let callingx: RNCallingxType | undefined;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
callingx = require('@stream-io/react-native-callingx').CallingxModule;
|
|
15
|
-
} catch {}
|
|
16
|
-
|
|
17
|
-
export function getCallingxLib() {
|
|
18
|
-
if (!callingx) {
|
|
19
|
-
throw Error('react-native-callingx library is not installed.');
|
|
20
|
-
}
|
|
21
|
-
return callingx;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function getCallingxLibIfAvailable() {
|
|
25
|
-
return callingx ?? undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function extractCallingExpOptions(
|
|
29
|
-
config: StreamVideoConfig,
|
|
30
|
-
): CallingExpOptions {
|
|
31
|
-
const { push: pushConfig, foregroundService: foregroundServiceConfig } =
|
|
32
|
-
config;
|
|
33
|
-
const callingExpOptions: CallingExpOptions = {};
|
|
34
|
-
|
|
35
|
-
if (pushConfig?.ios) {
|
|
36
|
-
const iosOptions: CallingExpOptions['ios'] = {};
|
|
37
|
-
if (pushConfig.ios.supportsVideo !== undefined) {
|
|
38
|
-
iosOptions.supportsVideo = pushConfig.ios.supportsVideo;
|
|
39
|
-
}
|
|
40
|
-
if (pushConfig.ios.sound !== undefined) {
|
|
41
|
-
iosOptions.sound = pushConfig.ios.sound;
|
|
42
|
-
}
|
|
43
|
-
if (pushConfig.ios.imageName !== undefined) {
|
|
44
|
-
iosOptions.imageName = pushConfig.ios.imageName;
|
|
45
|
-
}
|
|
46
|
-
if (pushConfig.ios.callsHistory !== undefined) {
|
|
47
|
-
iosOptions.callsHistory = pushConfig.ios.callsHistory;
|
|
48
|
-
}
|
|
49
|
-
if (pushConfig.ios.displayCallTimeout !== undefined) {
|
|
50
|
-
iosOptions.displayCallTimeout = pushConfig.ios.displayCallTimeout;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (Object.keys(iosOptions).length > 0) {
|
|
54
|
-
callingExpOptions.ios = iosOptions;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const androidOptions: CallingExpOptions['android'] = {};
|
|
59
|
-
if (pushConfig?.android) {
|
|
60
|
-
if (pushConfig.android.incomingChannel) {
|
|
61
|
-
androidOptions.incomingChannel = pushConfig.android.incomingChannel;
|
|
62
|
-
}
|
|
63
|
-
if (pushConfig.android.titleTransformer) {
|
|
64
|
-
androidOptions.titleTransformer = pushConfig.android.titleTransformer;
|
|
65
|
-
}
|
|
66
|
-
if (pushConfig.android.subtitleTransformer) {
|
|
67
|
-
androidOptions.subtitleTransformer =
|
|
68
|
-
pushConfig.android.subtitleTransformer;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (foregroundServiceConfig.android.channel) {
|
|
73
|
-
androidOptions.ongoingChannel = foregroundServiceConfig.android.channel;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (Object.keys(androidOptions).length > 0) {
|
|
77
|
-
callingExpOptions.android = androidOptions;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (pushConfig?.shouldRejectCallWhenBusy !== undefined) {
|
|
81
|
-
callingExpOptions.shouldRejectCallWhenBusy =
|
|
82
|
-
pushConfig.shouldRejectCallWhenBusy;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (pushConfig?.enableOngoingCalls !== undefined) {
|
|
86
|
-
callingExpOptions.enableOngoingCalls = pushConfig?.enableOngoingCalls;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return callingExpOptions;
|
|
90
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
2
|
-
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
3
|
-
import {
|
|
4
|
-
clearPushWSEventSubscriptions,
|
|
5
|
-
processCallFromPushInBackground,
|
|
6
|
-
} from './internal/utils';
|
|
7
|
-
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
8
|
-
import { resolvePendingAudioSession } from '../internal/callingx/audioSessionPromise';
|
|
9
|
-
import {
|
|
10
|
-
getCallingxLib,
|
|
11
|
-
type EventData,
|
|
12
|
-
type EventParams,
|
|
13
|
-
} from './libs/callingx';
|
|
14
|
-
import { Platform } from 'react-native';
|
|
15
|
-
|
|
16
|
-
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
17
|
-
|
|
18
|
-
const logger = videoLoggerSystem.getLogger('callingx');
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Sets up callingx event listeners for handling call actions from the native calling UI.
|
|
22
|
-
*/
|
|
23
|
-
export function setupCallingExpEvents(pushConfig: NonNullable<PushConfig>) {
|
|
24
|
-
const hasPushProvider =
|
|
25
|
-
(Platform.OS === 'android' && pushConfig.android?.pushProviderName) ||
|
|
26
|
-
(Platform.OS === 'ios' && pushConfig.ios?.pushProviderName);
|
|
27
|
-
|
|
28
|
-
if (!hasPushProvider) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const callingx = getCallingxLib();
|
|
33
|
-
|
|
34
|
-
const { remove: removeAnswerCall } = callingx.addEventListener(
|
|
35
|
-
'answerCall',
|
|
36
|
-
(params) => {
|
|
37
|
-
onAcceptCall(pushConfig)(params).catch((err) => {
|
|
38
|
-
logger.error('Failed to process answerCall event', err);
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const { remove: removeEndCall } = callingx.addEventListener(
|
|
44
|
-
'endCall',
|
|
45
|
-
(params) => {
|
|
46
|
-
onEndCall(pushConfig)(params).catch((err) => {
|
|
47
|
-
logger.error('Failed to process endCall event', err);
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const { remove: removeDidActivateAudioSession } = callingx.addEventListener(
|
|
53
|
-
'didActivateAudioSession',
|
|
54
|
-
onDidActivateAudioSession,
|
|
55
|
-
);
|
|
56
|
-
const { remove: removeDidDeactivateAudioSession } = callingx.addEventListener(
|
|
57
|
-
'didDeactivateAudioSession',
|
|
58
|
-
onDidDeactivateAudioSession,
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
//NOTE: until getInitialEvents invocation, events are delayed and won't be sent to event listeners, this is a way to make sure none of required events are missed
|
|
62
|
-
//in most cases there will be no delayed answers or ends, but it we don't want to miss any of them
|
|
63
|
-
const events = callingx.getInitialEvents();
|
|
64
|
-
events.forEach((event: EventData) => {
|
|
65
|
-
const { eventName, params } = event;
|
|
66
|
-
if (eventName === 'answerCall') {
|
|
67
|
-
logger.debug(`answerCall delayed event callId: ${params?.callId}`);
|
|
68
|
-
onAcceptCall(pushConfig)(params as EventParams['answerCall']).catch(
|
|
69
|
-
(err) => {
|
|
70
|
-
logger.error('Failed to process delayed answerCall event', err);
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
} else if (eventName === 'endCall') {
|
|
74
|
-
logger.debug(`endCall delayed event callId: ${params?.callId}`);
|
|
75
|
-
onEndCall(pushConfig)(params as EventParams['endCall']).catch((err) => {
|
|
76
|
-
logger.error('Failed to process delayed endCall event', err);
|
|
77
|
-
});
|
|
78
|
-
} else if (eventName === 'didActivateAudioSession') {
|
|
79
|
-
onDidActivateAudioSession();
|
|
80
|
-
} else if (eventName === 'didDeactivateAudioSession') {
|
|
81
|
-
onDidDeactivateAudioSession();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
setPushLogoutCallback(async () => {
|
|
86
|
-
removeAnswerCall();
|
|
87
|
-
removeEndCall();
|
|
88
|
-
removeDidActivateAudioSession();
|
|
89
|
-
removeDidDeactivateAudioSession();
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const onDidActivateAudioSession = () => {
|
|
94
|
-
logger.debug('callingExpDidActivateAudioSession');
|
|
95
|
-
resolvePendingAudioSession();
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const onDidDeactivateAudioSession = () => {
|
|
99
|
-
logger.debug('callingExpDidDeactivateAudioSession');
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const onAcceptCall =
|
|
103
|
-
(pushConfig: PushConfig) =>
|
|
104
|
-
async ({ callId: call_cid, source }: EventParams['answerCall']) => {
|
|
105
|
-
logger.debug(`onAcceptCall event callId: ${call_cid} source: ${source}`);
|
|
106
|
-
|
|
107
|
-
if (source === 'app' || !call_cid) {
|
|
108
|
-
//we only need to process the call if the call was answered from the system
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
clearPushWSEventSubscriptions(call_cid);
|
|
113
|
-
// to process the call in the app
|
|
114
|
-
await processCallFromPushInBackground(pushConfig, call_cid, 'accept');
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const onEndCall =
|
|
118
|
-
(pushConfig: PushConfig) =>
|
|
119
|
-
async ({ callId: call_cid, source }: EventParams['endCall']) => {
|
|
120
|
-
logger.debug(`onEndCall event callId: ${call_cid} source: ${source}`);
|
|
121
|
-
|
|
122
|
-
if (source === 'app' || !call_cid) {
|
|
123
|
-
//we only need to process the call if the call was rejected from the system
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
clearPushWSEventSubscriptions(call_cid);
|
|
128
|
-
|
|
129
|
-
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
130
|
-
};
|