@stream-io/video-react-native-sdk 1.29.0 → 1.29.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/AndroidManifest.xml +8 -1
- package/android/src/main/AndroidManifestNew.xml +11 -0
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +42 -5
- package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +70 -6
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +6 -4
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +83 -0
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +149 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +7 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +8 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +0 -2
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +121 -0
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +64 -97
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +26 -0
- 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 +33 -21
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +58 -0
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +1 -0
- package/dist/commonjs/utils/internal/callingx/callingx.js +109 -0
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +64 -3
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +48 -0
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +1 -0
- package/dist/commonjs/utils/push/android.js +155 -202
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +17 -34
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +1 -45
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +32 -20
- 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/callingx.js +75 -0
- package/dist/commonjs/utils/push/libs/callingx.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +8 -19
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +0 -19
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +108 -0
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +7 -6
- 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 +7 -2
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +8 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/hooks/push/index.js +0 -2
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +114 -0
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +66 -99
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +26 -0
- 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 +33 -21
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +51 -0
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +1 -0
- package/dist/module/utils/internal/callingx/callingx.js +100 -0
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +65 -4
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +42 -0
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +1 -0
- package/dist/module/utils/push/android.js +157 -204
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +17 -34
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +0 -44
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +29 -19
- 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/callingx.js +67 -0
- package/dist/module/utils/push/libs/callingx.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +1 -2
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +0 -18
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +102 -0
- package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +7 -6
- 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 +2 -2
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts +4 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +9 -6
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +1 -0
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +5 -0
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +20 -2
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +54 -29
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +16 -0
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +1 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +13 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +10 -0
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +1 -0
- package/dist/typescript/utils/push/android.d.ts +1 -2
- 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 +0 -33
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +8 -1
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +1 -2
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +9 -0
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +16 -2
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/index.d.ts +1 -2
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +8 -0
- package/dist/typescript/utils/push/setupCallingExpEvents.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 +1 -33
- package/expo-config-plugin/dist/withAndroidPermissions.js +2 -7
- package/expo-config-plugin/dist/withAppDelegate.js +19 -197
- package/expo-config-plugin/dist/withMainActivity.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +2 -3
- package/ios/PictureInPicture/StreamAVPictureInPictureVideoCallViewController.swift +8 -0
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +8 -0
- package/ios/PictureInPicture/StreamPictureInPictureVideoRenderer.swift +10 -0
- package/ios/RTCViewPip.swift +6 -0
- package/ios/RTCViewPipManager.mm +1 -0
- package/ios/StreamInCallManager.m +2 -0
- package/ios/StreamInCallManager.swift +19 -7
- package/ios/StreamVideoReactNative.h +7 -4
- package/ios/StreamVideoReactNative.m +209 -82
- package/package.json +14 -19
- package/src/components/Call/CallContent/CallContent.tsx +6 -1
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +18 -2
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +4 -7
- package/src/hooks/push/index.ts +0 -2
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +147 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +21 -34
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +94 -120
- package/src/index.ts +1 -0
- package/src/modules/call-manager/CallManager.ts +36 -0
- package/src/modules/call-manager/native-module.d.ts +7 -0
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +40 -30
- package/src/utils/StreamVideoRN/types.ts +56 -29
- package/src/utils/internal/callingx/audioSessionPromise.ts +53 -0
- package/src/utils/internal/callingx/callingx.ts +146 -0
- package/src/utils/internal/registerSDKGlobals.ts +66 -4
- package/src/utils/keepCallAliveHeadlessTask.ts +54 -0
- package/src/utils/push/android.ts +231 -309
- package/src/utils/push/internal/ios.ts +28 -44
- package/src/utils/push/internal/rxSubjects.ts +0 -61
- package/src/utils/push/internal/utils.ts +45 -26
- package/src/utils/push/ios.ts +1 -6
- package/src/utils/push/libs/callingx.ts +90 -0
- package/src/utils/push/libs/index.ts +1 -2
- package/src/utils/push/libs/notifee/index.ts +0 -27
- package/src/utils/push/setupCallingExpEvents.ts +130 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +11 -7
- package/src/version.ts +1 -1
- package/CHANGELOG.md +0 -3114
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +0 -95
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -160
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +0 -67
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +0 -17
- package/dist/commonjs/utils/push/libs/callkeep.js.map +0 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +0 -17
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +0 -1
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +0 -205
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +0 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -153
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +0 -60
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +0 -1
- package/dist/module/utils/push/libs/callkeep.js +0 -11
- package/dist/module/utils/push/libs/callkeep.js.map +0 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +0 -11
- package/dist/module/utils/push/libs/voipPushNotification.js.map +0 -1
- package/dist/module/utils/push/setupIosCallKeepEvents.js +0 -199
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +0 -8
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +0 -3
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +0 -3
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +0 -6
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +0 -1
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +0 -235
- package/src/hooks/push/useProcessPushCallEffect.ts +0 -108
- package/src/utils/push/libs/callkeep.ts +0 -16
- package/src/utils/push/libs/voipPushNotification.ts +0 -17
- package/src/utils/push/setupIosCallKeepEvents.ts +0 -252
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Internal utils for callingx library usage from video-client.
|
|
3
|
+
* See @./registerSDKGlobals.ts for more usage details.
|
|
4
|
+
*/
|
|
5
|
+
import { Platform } from 'react-native';
|
|
6
|
+
import { getCallingxLibIfAvailable } from '../../push/libs/callingx';
|
|
7
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
8
|
+
import { waitForAudioSessionActivation } from './audioSessionPromise';
|
|
9
|
+
const CallingxModule = getCallingxLibIfAvailable();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gets the call display name. To be used for display in native call screen.
|
|
13
|
+
*/
|
|
14
|
+
export function getCallDisplayName(callMembers, participants, currentUserId) {
|
|
15
|
+
if (!callMembers || !participants || !currentUserId) {
|
|
16
|
+
return 'Call';
|
|
17
|
+
}
|
|
18
|
+
let names = [];
|
|
19
|
+
if (callMembers.length > 0) {
|
|
20
|
+
// for ringing calls, members array contains all call members from the very early state and participants array is empty in the beginning
|
|
21
|
+
names = callMembers.filter(member => member.user.id !== currentUserId).map(member => member.user.name).filter(name => name !== undefined);
|
|
22
|
+
} else if (participants.length > 0) {
|
|
23
|
+
// for non-ringing calls, members array is empty and we rely on participants array there
|
|
24
|
+
names = participants.filter(participant => participant.userId !== currentUserId).map(participant => participant.name).filter(Boolean);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// if no names are found, we use the name of the current user
|
|
28
|
+
if (names.length === 0) {
|
|
29
|
+
names = [participants.find(participant => participant.userId === currentUserId)?.name ?? 'Call'];
|
|
30
|
+
}
|
|
31
|
+
return names.sort().join(', ');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Starts the call in the callingx library.
|
|
36
|
+
* Must be called for all outgoing calls
|
|
37
|
+
* and optionally for non-ringing calls when ongoing calls are enabled.
|
|
38
|
+
*/
|
|
39
|
+
export async function startCallingxCall(call) {
|
|
40
|
+
if (!CallingxModule || !CallingxModule.isSetup) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const logger = videoLoggerSystem.getLogger('callingx');
|
|
44
|
+
const isOutcomingCall = call.ringing && call.isCreatedByMe;
|
|
45
|
+
const isIncomingCall = call.ringing && !call.isCreatedByMe;
|
|
46
|
+
const callDisplayName = getCallDisplayName(call.state.members, call.state.participants, call.currentUserId);
|
|
47
|
+
if (!CallingxModule.isCallTracked(call.cid) && (isOutcomingCall || !call.ringing && CallingxModule.isOngoingCallsEnabled)) {
|
|
48
|
+
try {
|
|
49
|
+
await CallingxModule.startCall(call.cid,
|
|
50
|
+
// unique id for call
|
|
51
|
+
call.id,
|
|
52
|
+
// phone number for display in dialer (we use call id as phone number)
|
|
53
|
+
callDisplayName,
|
|
54
|
+
// display name for display in call screen
|
|
55
|
+
call.state.settings?.video?.enabled ?? false // is video call?
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Wait for audio session activation on iOS only
|
|
59
|
+
if (Platform.OS === 'ios') {
|
|
60
|
+
await waitForAudioSessionActivation();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// TODO: this must be done after join call is complete
|
|
64
|
+
CallingxModule.setCurrentCallActive(call.cid);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
logger.error(`startCallingxCall: Error starting call in callingx: ${call.cid}`, error);
|
|
67
|
+
}
|
|
68
|
+
} else if (isIncomingCall) {
|
|
69
|
+
try {
|
|
70
|
+
// Awaits native CallKit/Telecom registration before answering.
|
|
71
|
+
// Safe to call even if the call is already registered (e.g. from VoIP push) --
|
|
72
|
+
// iOS early-returns with no error, Android sends the registered broadcast.
|
|
73
|
+
await CallingxModule.displayIncomingCall(call.cid,
|
|
74
|
+
// unique id for call
|
|
75
|
+
call.id,
|
|
76
|
+
// phone number for display in dialer (we use call id as phone number)
|
|
77
|
+
callDisplayName,
|
|
78
|
+
// display name for display in call screen
|
|
79
|
+
call.state.settings?.video?.enabled ?? false // is video call?
|
|
80
|
+
);
|
|
81
|
+
await CallingxModule.answerIncomingCall(call.cid);
|
|
82
|
+
if (Platform.OS === 'ios') {
|
|
83
|
+
await waitForAudioSessionActivation();
|
|
84
|
+
}
|
|
85
|
+
} catch (error) {
|
|
86
|
+
logger.error(`Error displaying incoming call in callingx: ${call.cid}`, error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export async function endCallingxCall(call) {
|
|
91
|
+
if (!CallingxModule || !CallingxModule.isSetup || !CallingxModule.isCallTracked(call.cid)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await CallingxModule.endCallWithReason(call.cid, 'local');
|
|
96
|
+
} catch (error) {
|
|
97
|
+
videoLoggerSystem.getLogger('callingx').error(`endCallingxCall: Error ending call in callingx: ${call.cid}`, error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=callingx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","getCallingxLibIfAvailable","videoLoggerSystem","waitForAudioSessionActivation","CallingxModule","getCallDisplayName","callMembers","participants","currentUserId","names","length","filter","member","user","id","map","name","undefined","participant","userId","Boolean","find","sort","join","startCallingxCall","call","isSetup","logger","getLogger","isOutcomingCall","ringing","isCreatedByMe","isIncomingCall","callDisplayName","state","members","isCallTracked","cid","isOngoingCallsEnabled","startCall","settings","video","enabled","OS","setCurrentCallActive","error","displayIncomingCall","answerIncomingCall","endCallingxCall","endCallWithReason"],"sourceRoot":"../../../../../src","sources":["utils/internal/callingx/callingx.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,yBAAyB,QAAQ,0BAA0B;AACpE,SAIEC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,6BAA6B,QAAQ,uBAAuB;AAErE,MAAMC,cAAc,GAAGH,yBAAyB,CAAC,CAAC;;AAElD;AACA;AACA;AACA,OAAO,SAASI,kBAAkBA,CAChCC,WAAyC,EACzCC,YAAkD,EAClDC,aAAiC,EACjC;EACA,IAAI,CAACF,WAAW,IAAI,CAACC,YAAY,IAAI,CAACC,aAAa,EAAE;IACnD,OAAO,MAAM;EACf;EAEA,IAAIC,KAAe,GAAG,EAAE;EAExB,IAAIH,WAAW,CAACI,MAAM,GAAG,CAAC,EAAE;IAC1B;IACAD,KAAK,GAAGH,WAAW,CAChBK,MAAM,CAAEC,MAAM,IAAKA,MAAM,CAACC,IAAI,CAACC,EAAE,KAAKN,aAAa,CAAC,CACpDO,GAAG,CAAEH,MAAM,IAAKA,MAAM,CAACC,IAAI,CAACG,IAAI,CAAC,CACjCL,MAAM,CAAEK,IAAI,IAAqBA,IAAI,KAA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CAAC,EACvC;IACA;EACF;EAEA,IAAI;IACF,MAAMjC,cAAc,CAAC6C,iBAAiB,CAACxB,IAAI,CAACY,GAAG,EAAE,OAAO,CAAC;EAC3D,CAAC,CAAC,OAAOQ,KAAK,EAAE;IACd3C,iBAAiB,CACd0B,SAAS,CAAC,UAAU,CAAC,CACrBiB,KAAK,CACJ,mDAAmDpB,IAAI,CAACY,GAAG,EAAE,EAC7DQ,KACF,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -1,19 +1,80 @@
|
|
|
1
|
-
import { NativeModules } from 'react-native';
|
|
1
|
+
import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
|
|
2
|
+
import { getCallingxLibIfAvailable } from '../push/libs/callingx';
|
|
3
|
+
import { endCallingxCall, startCallingxCall } from './callingx/callingx';
|
|
2
4
|
const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
|
|
5
|
+
const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative;
|
|
6
|
+
const CallingxModule = getCallingxLibIfAvailable();
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Checks if StreamInCallManager should be bypassed because CallKit is handling
|
|
10
|
+
* the audio session via CallingX.
|
|
11
|
+
*
|
|
12
|
+
* On iOS, when CallingX is set up and has a registered call, the audio session
|
|
13
|
+
* is managed by CallKit through CallingxImpl.swift.
|
|
14
|
+
* In this case, StreamInCallManager should not run to avoid conflicting audio
|
|
15
|
+
* session configurations.
|
|
16
|
+
*/
|
|
17
|
+
const shouldBypassForCallKit = ({
|
|
18
|
+
isRingingTypeCall
|
|
19
|
+
}) => {
|
|
20
|
+
if (Platform.OS !== 'ios') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (!CallingxModule) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const bypass = CallingxModule.isSetup && (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
|
|
27
|
+
return bypass;
|
|
28
|
+
};
|
|
3
29
|
const streamRNVideoSDKGlobals = {
|
|
30
|
+
callingX: {
|
|
31
|
+
startCall: startCallingxCall,
|
|
32
|
+
endCall: endCallingxCall
|
|
33
|
+
},
|
|
4
34
|
callManager: {
|
|
5
35
|
setup: ({
|
|
6
|
-
defaultDevice
|
|
36
|
+
defaultDevice,
|
|
37
|
+
isRingingTypeCall
|
|
7
38
|
}) => {
|
|
39
|
+
if (shouldBypassForCallKit({
|
|
40
|
+
isRingingTypeCall
|
|
41
|
+
})) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
8
44
|
StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
9
45
|
StreamInCallManagerNativeModule.setup();
|
|
10
46
|
},
|
|
11
|
-
start: (
|
|
47
|
+
start: ({
|
|
48
|
+
isRingingTypeCall
|
|
49
|
+
}) => {
|
|
50
|
+
if (shouldBypassForCallKit({
|
|
51
|
+
isRingingTypeCall
|
|
52
|
+
})) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
12
55
|
StreamInCallManagerNativeModule.start();
|
|
13
56
|
},
|
|
14
|
-
stop: (
|
|
57
|
+
stop: ({
|
|
58
|
+
isRingingTypeCall
|
|
59
|
+
}) => {
|
|
60
|
+
if (shouldBypassForCallKit({
|
|
61
|
+
isRingingTypeCall
|
|
62
|
+
})) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
15
65
|
StreamInCallManagerNativeModule.stop();
|
|
16
66
|
}
|
|
67
|
+
},
|
|
68
|
+
permissions: {
|
|
69
|
+
check: async permission => {
|
|
70
|
+
if (Platform.OS === 'android') {
|
|
71
|
+
const nativeAndroidPermission = permission === 'camera' ? PermissionsAndroid.PERMISSIONS.CAMERA : PermissionsAndroid.PERMISSIONS.RECORD_AUDIO;
|
|
72
|
+
return PermissionsAndroid.check(nativeAndroidPermission);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// use our own service on iOS
|
|
76
|
+
return Boolean(await StreamVideoReactNativeModule.checkPermission?.(permission));
|
|
77
|
+
}
|
|
17
78
|
}
|
|
18
79
|
};
|
|
19
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","StreamInCallManagerNativeModule","StreamInCallManager","streamRNVideoSDKGlobals","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":"AACA,SAASA,aAAa,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["NativeModules","PermissionsAndroid","Platform","getCallingxLibIfAvailable","endCallingxCall","startCallingxCall","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","shouldBypassForCallKit","isRingingTypeCall","OS","bypass","isSetup","isOngoingCallsEnabled","streamRNVideoSDKGlobals","callingX","startCall","endCall","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":"AACA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC1E,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,qBAAqB;AAExE,MAAMC,+BAA+B,GAAGN,aAAa,CAACO,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGR,aAAa,CAACS,sBAElD;AAED,MAAMC,cAAc,GAAGP,yBAAyB,CAAC,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,sBAAsB,GAAGA,CAAC;EAC9BC;AAGF,CAAC,KAAc;EACb,IAAIV,QAAQ,CAACW,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,KAAK;EACd;EACA,IAAI,CA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4BAA4B,CAAC2B,eAAe,GAAGN,UAAU,CACjE,CAAC;IACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASO,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,MAAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGrB,uBAAuB;EACnD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AppRegistry, Platform } from 'react-native';
|
|
2
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
3
|
+
import { StreamVideoRN } from './StreamVideoRN';
|
|
4
|
+
export const KEEP_CALL_ALIVE_HEADLESS_TASK_NAME = 'StreamVideoKeepCallAlive';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The keep-alive headless task needs access to the active `Call` instance.
|
|
8
|
+
* The keep-alive hook will set this reference before starting the native service.
|
|
9
|
+
*/
|
|
10
|
+
export const keepCallAliveCallRef = {
|
|
11
|
+
current: undefined
|
|
12
|
+
};
|
|
13
|
+
function registerKeepCallAliveHeadlessTaskOnce() {
|
|
14
|
+
if (Platform.OS !== 'android') return;
|
|
15
|
+
AppRegistry.registerHeadlessTask(KEEP_CALL_ALIVE_HEADLESS_TASK_NAME, () => async data => {
|
|
16
|
+
const logger = videoLoggerSystem.getLogger('KEEP_CALL_ALIVE_HEADLESS_TASK');
|
|
17
|
+
const callCid = data?.callCid;
|
|
18
|
+
const call = keepCallAliveCallRef.current;
|
|
19
|
+
if (!call) {
|
|
20
|
+
logger.warn('No active call instance available for keep-alive task; skipping.', {
|
|
21
|
+
callCid
|
|
22
|
+
});
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (callCid && call.cid && call.cid !== callCid) {
|
|
26
|
+
logger.warn('Keep-alive task callCid does not match active call; skipping.', {
|
|
27
|
+
callCid,
|
|
28
|
+
activeCallCid: call.cid
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const config = StreamVideoRN.getConfig();
|
|
33
|
+
const taskToRun = config.foregroundService.android.taskToRun;
|
|
34
|
+
try {
|
|
35
|
+
await taskToRun(call);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
logger.error('Keep-alive headless task failed', e);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
registerKeepCallAliveHeadlessTaskOnce();
|
|
42
|
+
//# sourceMappingURL=keepCallAliveHeadlessTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AppRegistry","Platform","videoLoggerSystem","StreamVideoRN","KEEP_CALL_ALIVE_HEADLESS_TASK_NAME","keepCallAliveCallRef","current","undefined","registerKeepCallAliveHeadlessTaskOnce","OS","registerHeadlessTask","data","logger","getLogger","callCid","call","warn","cid","activeCallCid","config","getConfig","taskToRun","foregroundService","android","e","error"],"sourceRoot":"../../../src","sources":["utils/keepCallAliveHeadlessTask.ts"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,cAAc;AAEpD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,OAAO,MAAMC,kCAAkC,GAAG,0BAA0B;;AAE5E;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAmD,GAAG;EACjEC,OAAO,EAAEC;AACX,CAAC;AAED,SAASC,qCAAqCA,CAAA,EAAG;EAC/C,IAAIP,QAAQ,CAACQ,EAAE,KAAK,SAAS,EAAE;EAE/BT,WAAW,CAACU,oBAAoB,CAC9BN,kCAAkC,EAClC,MAAM,MAAOO,IAAsC,IAAK;IACtD,MAAMC,MAAM,GAAGV,iBAAiB,CAACW,SAAS,CACxC,+BACF,CAAC;IACD,MAAMC,OAAO,GAAGH,IAAI,EAAEG,OAAO;IAE7B,MAAMC,IAAI,GAAGV,oBAAoB,CAACC,OAAO;IACzC,IAAI,CAACS,IAAI,EAAE;MACTH,MAAM,CAACI,IAAI,CACT,kEA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