@stream-io/video-react-native-sdk 1.29.0-beta.3 → 1.29.1
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 +3126 -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 +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/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/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/internal/registerSDKGlobals.js +15 -52
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +202 -155
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +32 -16
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +20 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +16 -28
- 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 +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/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/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/internal/registerSDKGlobals.js +16 -53
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +204 -157
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +32 -16
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +19 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +15 -25
- 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 +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/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/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/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 +12 -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/firebaseMessaging/index.d.ts +2 -16
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- 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/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 +0 -2
- package/ios/StreamInCallManager.swift +7 -19
- package/ios/StreamVideoReactNative.h +4 -7
- package/ios/StreamVideoReactNative.m +102 -191
- package/package.json +19 -14
- 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/useIosCallkeepWithCallingStateEffect.ts +235 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
- 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/internal/registerSDKGlobals.ts +23 -47
- package/src/utils/push/android.ts +309 -231
- package/src/utils/push/internal/ios.ts +42 -27
- package/src/utils/push/internal/rxSubjects.ts +29 -0
- package/src/utils/push/internal/utils.ts +15 -38
- 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 -134
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/utils/internal/audioSessionPromise.js +0 -57
- package/dist/commonjs/utils/internal/audioSessionPromise.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx.js +0 -136
- package/dist/commonjs/utils/internal/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 -97
- 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/internal/audioSessionPromise.js +0 -50
- package/dist/module/utils/internal/audioSessionPromise.js.map +0 -1
- package/dist/module/utils/internal/callingx.js +0 -127
- package/dist/module/utils/internal/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 -91
- 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/internal/audioSessionPromise.d.ts +0 -16
- package/dist/typescript/utils/internal/audioSessionPromise.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx.d.ts +0 -13
- package/dist/typescript/utils/internal/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/internal/audioSessionPromise.ts +0 -52
- package/src/utils/internal/callingx.ts +0 -192
- package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
- package/src/utils/push/libs/callingx.ts +0 -90
- package/src/utils/push/setupCallingExpEvents.ts +0 -117
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractCallingExpOptions = extractCallingExpOptions;
|
|
7
|
-
exports.getCallingxLib = getCallingxLib;
|
|
8
|
-
exports.getCallingxLibIfAvailable = getCallingxLibIfAvailable;
|
|
9
|
-
let callingx;
|
|
10
|
-
try {
|
|
11
|
-
callingx = require('@stream-io/react-native-callingx').CallingxModule;
|
|
12
|
-
} catch {}
|
|
13
|
-
function getCallingxLib() {
|
|
14
|
-
if (!callingx) {
|
|
15
|
-
throw Error('react-native-callingx library is not installed.');
|
|
16
|
-
}
|
|
17
|
-
return callingx;
|
|
18
|
-
}
|
|
19
|
-
function getCallingxLibIfAvailable() {
|
|
20
|
-
return callingx ?? undefined;
|
|
21
|
-
}
|
|
22
|
-
function extractCallingExpOptions(config) {
|
|
23
|
-
const {
|
|
24
|
-
push: pushConfig,
|
|
25
|
-
foregroundService: foregroundServiceConfig
|
|
26
|
-
} = config;
|
|
27
|
-
const callingExpOptions = {};
|
|
28
|
-
if (pushConfig?.ios) {
|
|
29
|
-
const iosOptions = {};
|
|
30
|
-
if (pushConfig.ios.supportsVideo !== undefined) {
|
|
31
|
-
iosOptions.supportsVideo = pushConfig.ios.supportsVideo;
|
|
32
|
-
}
|
|
33
|
-
if (pushConfig.ios.sound !== undefined) {
|
|
34
|
-
iosOptions.sound = pushConfig.ios.sound;
|
|
35
|
-
}
|
|
36
|
-
if (pushConfig.ios.imageName !== undefined) {
|
|
37
|
-
iosOptions.imageName = pushConfig.ios.imageName;
|
|
38
|
-
}
|
|
39
|
-
if (pushConfig.ios.callsHistory !== undefined) {
|
|
40
|
-
iosOptions.callsHistory = pushConfig.ios.callsHistory;
|
|
41
|
-
}
|
|
42
|
-
if (pushConfig.ios.displayCallTimeout !== undefined) {
|
|
43
|
-
iosOptions.displayCallTimeout = pushConfig.ios.displayCallTimeout;
|
|
44
|
-
}
|
|
45
|
-
if (Object.keys(iosOptions).length > 0) {
|
|
46
|
-
callingExpOptions.ios = iosOptions;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const androidOptions = {};
|
|
50
|
-
if (pushConfig?.android) {
|
|
51
|
-
if (pushConfig.android.incomingChannel) {
|
|
52
|
-
androidOptions.incomingChannel = pushConfig.android.incomingChannel;
|
|
53
|
-
}
|
|
54
|
-
if (pushConfig.android.titleTransformer) {
|
|
55
|
-
androidOptions.titleTransformer = pushConfig.android.titleTransformer;
|
|
56
|
-
}
|
|
57
|
-
if (pushConfig.android.subtitleTransformer) {
|
|
58
|
-
androidOptions.subtitleTransformer = pushConfig.android.subtitleTransformer;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (foregroundServiceConfig.android.channel) {
|
|
62
|
-
androidOptions.ongoingChannel = foregroundServiceConfig.android.channel;
|
|
63
|
-
}
|
|
64
|
-
if (Object.keys(androidOptions).length > 0) {
|
|
65
|
-
callingExpOptions.android = androidOptions;
|
|
66
|
-
}
|
|
67
|
-
if (pushConfig?.shouldRejectCallWhenBusy !== undefined) {
|
|
68
|
-
callingExpOptions.shouldRejectCallWhenBusy = pushConfig.shouldRejectCallWhenBusy;
|
|
69
|
-
}
|
|
70
|
-
if (pushConfig?.enableOngoingCalls !== undefined) {
|
|
71
|
-
callingExpOptions.enableOngoingCalls = pushConfig?.enableOngoingCalls;
|
|
72
|
-
}
|
|
73
|
-
return callingExpOptions;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=callingx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["callingx","require","CallingxModule","getCallingxLib","Error","getCallingxLibIfAvailable","undefined","extractCallingExpOptions","config","push","pushConfig","foregroundService","foregroundServiceConfig","callingExpOptions","ios","iosOptions","supportsVideo","sound","imageName","callsHistory","displayCallTimeout","Object","keys","length","androidOptions","android","incomingChannel","titleTransformer","subtitleTransformer","channel","ongoingChannel","shouldRejectCallWhenBusy","enableOngoingCalls"],"sourceRoot":"../../../../../src","sources":["utils/push/libs/callingx.ts"],"mappings":";;;;;;;;AAUA,IAAIA,QAAoC;AAExC,IAAI;EACFA,QAAQ,GAAGC,OAAO,CAAC,kCAAkC,CAAC,CAACC,cAAc;AACvE,CAAC,CAAC,MAAM,CAAC;AAEF,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAI,CAACH,QAAQ,EAAE;IACb,MAAMI,KAAK,CAAC,iDAAiD,CAAC;EAChE;EACA,OAAOJ,QAAQ;AACjB;AAEO,SAASK,yBAAyBA,CAAA,EAAG;EAC1C,OAAOL,QAAQ,IAAIM,SAAS;AAC9B;AAEO,SAASC,wBAAwBA,CACtCC,MAAyB,EACN;EACnB,MAAM;IAAEC,IAAI,EAAEC,UAAU;IAAEC,iBAAiB,EAAEC;EAAwB,CAAC,GACpEJ,MAAM;EACR,MAAMK,iBAAoC,GAAG,CAAC,CAAC;EAE/C,IAAIH,UAAU,EAAEI,GAAG,EAAE;IACnB,MAAMC,UAAoC,GAAG,CAAC,CAAC;IAC/C,IAAIL,UAAU,CAACI,GAAG,CAACE,aAAa,KAAKV,SAAS,EAAE;MAC9CS,UAAU,CAACC,aAAa,GAAGN,UAAU,CAACI,GAAG,CAACE,aAAa;IACzD;IACA,IAAIN,UAAU,CAACI,GAAG,CAACG,KAAK,KAAKX,SAAS,EAAE;MACtCS,UAAU,CAACE,KAAK,GAAGP,UAAU,CAACI,GAAG,CAACG,KAAK;IACzC;IACA,IAAIP,UAAU,CAACI,GAAG,CAACI,SAAS,KAAKZ,SAAS,E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S,EAAE;IACtDO,iBAAiB,CAACkB,wBAAwB,GACxCrB,UAAU,CAACqB,wBAAwB;EACvC;EAEA,IAAIrB,UAAU,EAAEsB,kBAAkB,KAAK1B,SAAS,EAAE;IAChDO,iBAAiB,CAACmB,kBAAkB,GAAGtB,UAAU,EAAEsB,kBAAkB;EACvE;EAEA,OAAOnB,iBAAiB;AAC1B","ignoreList":[]}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setupCallingExpEvents = setupCallingExpEvents;
|
|
7
|
-
var _rxSubjects = require("./internal/rxSubjects");
|
|
8
|
-
var _videoClient = require("@stream-io/video-client");
|
|
9
|
-
var _utils = require("./internal/utils");
|
|
10
|
-
var _pushLogoutCallback = require("../internal/pushLogoutCallback");
|
|
11
|
-
var _audioSessionPromise = require("../internal/audioSessionPromise");
|
|
12
|
-
var _callingx = require("./libs/callingx");
|
|
13
|
-
var _reactNative = require("react-native");
|
|
14
|
-
const logger = _videoClient.videoLoggerSystem.getLogger('Callingx');
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This hook is used to listen to callkeep events and do the necessary actions
|
|
18
|
-
*/
|
|
19
|
-
function setupCallingExpEvents(pushConfig) {
|
|
20
|
-
const hasPushProvider = _reactNative.Platform.OS === 'android' && pushConfig.android?.pushProviderName || _reactNative.Platform.OS === 'ios' && pushConfig.ios?.pushProviderName;
|
|
21
|
-
if (!hasPushProvider) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const callingx = (0, _callingx.getCallingxLib)();
|
|
25
|
-
const {
|
|
26
|
-
remove: removeAnswerCall
|
|
27
|
-
} = callingx.addEventListener('answerCall', onAcceptCall);
|
|
28
|
-
const {
|
|
29
|
-
remove: removeEndCall
|
|
30
|
-
} = callingx.addEventListener('endCall', onEndCall(pushConfig));
|
|
31
|
-
const {
|
|
32
|
-
remove: removeDidActivateAudioSession
|
|
33
|
-
} = callingx.addEventListener('didActivateAudioSession', onDidActivateAudioSession);
|
|
34
|
-
const {
|
|
35
|
-
remove: removeDidDeactivateAudioSession
|
|
36
|
-
} = callingx.addEventListener('didDeactivateAudioSession', onDidDeactivateAudioSession);
|
|
37
|
-
|
|
38
|
-
//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
|
|
39
|
-
//in most cases there will be no delayed answers or ends, but it we don't want to miss any of them
|
|
40
|
-
const events = callingx.getInitialEvents();
|
|
41
|
-
events.forEach(event => {
|
|
42
|
-
const {
|
|
43
|
-
eventName,
|
|
44
|
-
params
|
|
45
|
-
} = event;
|
|
46
|
-
if (eventName === 'answerCall') {
|
|
47
|
-
logger.debug(`answerCall delayed event callId: ${params?.callId}`);
|
|
48
|
-
onAcceptCall(params);
|
|
49
|
-
} else if (eventName === 'endCall') {
|
|
50
|
-
logger.debug(`endCall delayed event callId: ${params?.callId}`);
|
|
51
|
-
onEndCall(pushConfig)(params);
|
|
52
|
-
} else if (eventName === 'didActivateAudioSession') {
|
|
53
|
-
onDidActivateAudioSession();
|
|
54
|
-
} else if (eventName === 'didDeactivateAudioSession') {
|
|
55
|
-
onDidDeactivateAudioSession();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
(0, _pushLogoutCallback.setPushLogoutCallback)(async () => {
|
|
59
|
-
removeAnswerCall();
|
|
60
|
-
removeEndCall();
|
|
61
|
-
removeDidActivateAudioSession();
|
|
62
|
-
removeDidDeactivateAudioSession();
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
const onDidActivateAudioSession = () => {
|
|
66
|
-
logger.debug('callingExpDidActivateAudioSession');
|
|
67
|
-
(0, _audioSessionPromise.resolvePendingAudioSession)();
|
|
68
|
-
};
|
|
69
|
-
const onDidDeactivateAudioSession = () => {
|
|
70
|
-
logger.debug('callingExpDidDeactivateAudioSession');
|
|
71
|
-
};
|
|
72
|
-
const onAcceptCall = ({
|
|
73
|
-
callId: call_cid,
|
|
74
|
-
source
|
|
75
|
-
}) => {
|
|
76
|
-
logger.debug(`onAcceptCall event callId: ${call_cid} source: ${source}`);
|
|
77
|
-
if (source === 'app' || !call_cid) {
|
|
78
|
-
//we only need to process the call if the call was answered from the system
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
(0, _utils.clearPushWSEventSubscriptions)(call_cid);
|
|
82
|
-
// to process the call in the app
|
|
83
|
-
_rxSubjects.pushAcceptedIncomingCallCId$.next(call_cid);
|
|
84
|
-
};
|
|
85
|
-
const onEndCall = pushConfig => async ({
|
|
86
|
-
callId: call_cid,
|
|
87
|
-
source
|
|
88
|
-
}) => {
|
|
89
|
-
logger.debug(`onEndCall event callId: ${call_cid} source: ${source}`);
|
|
90
|
-
if (source === 'app' || !call_cid) {
|
|
91
|
-
//we only need to process the call if the call was rejected from the system
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
(0, _utils.clearPushWSEventSubscriptions)(call_cid);
|
|
95
|
-
await (0, _utils.processCallFromPushInBackground)(pushConfig, call_cid, 'decline');
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=setupCallingExpEvents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_rxSubjects","require","_videoClient","_utils","_pushLogoutCallback","_audioSessionPromise","_callingx","_reactNative","logger","videoLoggerSystem","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","Platform","OS","android","pushProviderName","ios","callingx","getCallingxLib","remove","removeAnswerCall","addEventListener","onAcceptCall","removeEndCall","onEndCall","removeDidActivateAudioSession","onDidActivateAudioSession","removeDidDeactivateAudioSession","onDidDeactivateAudioSession","events","getInitialEvents","forEach","event","eventName","params","debug","callId","setPushLogoutCallback","resolvePendingAudioSession","call_cid","source","clearPushWSEventSubscriptions","pushAcceptedIncomingCallCId$","next","processCallFromPushInBackground"],"sourceRoot":"../../../../src","sources":["utils/push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;EACvC;EACAG,wCAA4B,CAACC,IAAI,CAACJ,QAAQ,CAAC;AAC7C,CAAC;AAED,MAAMf,SAAS,GACZd,UAAsB,IACvB,OAAO;EAAE0B,MAAM,EAAEG,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EAC9DlC,MAAM,CAAC6B,KAAK,CAAC,2BAA2BI,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAErE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEA,IAAAE,oCAA6B,EAACF,QAAQ,CAAC;EAEvC,MAAM,IAAAK,sCAA+B,EAAClC,UAAU,EAAE6B,QAAQ,EAAE,SAAS,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
2
|
-
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
3
|
-
import { useEffect, useMemo } from 'react';
|
|
4
|
-
import { getCallDisplayName } from '../../utils/internal/callingx';
|
|
5
|
-
import { getCallingxLibIfAvailable } from '../../utils/push/libs/callingx';
|
|
6
|
-
const logger = videoLoggerSystem.getLogger('Callingx - useCallingExpWithCallingStateEffect');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This hook is used to inform sync call state with CallKit/Telecom (i.e. start call, end call, mute/unmute call).
|
|
10
|
-
*/
|
|
11
|
-
export const useCallingExpWithCallingStateEffect = () => {
|
|
12
|
-
const {
|
|
13
|
-
useMicrophoneState,
|
|
14
|
-
useParticipants,
|
|
15
|
-
useCallMembers
|
|
16
|
-
} = useCallStateHooks();
|
|
17
|
-
const activeCall = useCall();
|
|
18
|
-
const {
|
|
19
|
-
isMute,
|
|
20
|
-
microphone
|
|
21
|
-
} = useMicrophoneState();
|
|
22
|
-
const callMembers = useCallMembers();
|
|
23
|
-
const participants = useParticipants();
|
|
24
|
-
const activeCallCid = activeCall?.cid;
|
|
25
|
-
const currentUserId = activeCall?.currentUserId;
|
|
26
|
-
const callDisplayName = useMemo(() => getCallDisplayName(callMembers, participants, currentUserId), [callMembers, participants, currentUserId]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
return () => {
|
|
29
|
-
const callingx = getCallingxLibIfAvailable();
|
|
30
|
-
if (!callingx?.isSetup || !activeCallCid) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const isCallRegistered = callingx.isCallRegistered(activeCallCid);
|
|
34
|
-
if (!isCallRegistered) {
|
|
35
|
-
logger.debug(`No active call cid to end in calling exp: ${activeCallCid} isCallRegistered: ${isCallRegistered}`);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
//if incoming stream call was unmounted, we need to end the call in CallKit/Telecom
|
|
39
|
-
logger.debug(`Ending call in callingx: ${activeCallCid}`);
|
|
40
|
-
callingx.endCallWithReason(activeCallCid, 'local').catch(error => {
|
|
41
|
-
logger.error(`Error ending call in callingx: ${activeCallCid}`, error);
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
}, [activeCallCid]);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
const callingx = getCallingxLibIfAvailable();
|
|
47
|
-
if (!callingx?.isSetup || !activeCallCid) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const isCallRegistered = callingx.isCallRegistered(activeCallCid);
|
|
51
|
-
if (!isCallRegistered) {
|
|
52
|
-
logger.debug(`No active call cid to update callingx: ${activeCallCid} isCallRegistered: ${isCallRegistered}`);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
callingx.updateDisplay(activeCallCid, activeCallCid, callDisplayName);
|
|
56
|
-
}, [activeCallCid, callDisplayName]);
|
|
57
|
-
|
|
58
|
-
// Sync microphone mute state from app → CallKit
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const callingx = getCallingxLibIfAvailable();
|
|
61
|
-
if (!callingx?.isSetup || !activeCallCid) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const isCallRegistered = callingx.isCallRegistered(activeCallCid);
|
|
65
|
-
if (!isCallRegistered) {
|
|
66
|
-
logger.debug(`No active call cid to set muted in calling exp: ${activeCallCid} isCallRegistered: ${isCallRegistered}`);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
callingx.setMutedCall(activeCallCid, isMute);
|
|
70
|
-
}, [activeCallCid, isMute]);
|
|
71
|
-
|
|
72
|
-
// Sync mute state from CallKit → app (only for system-initiated mute actions)
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
const callingx = getCallingxLibIfAvailable();
|
|
75
|
-
if (!callingx?.isSetup || !activeCallCid) {
|
|
76
|
-
logger.debug(`No active call cid to set muted in calling exp: ${activeCallCid} callingx isSetup: ${callingx?.isSetup}`);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Listen to mic toggle events from CallKit/Telecom and update stream call microphone state.
|
|
81
|
-
// Only system-initiated mute actions (e.g. user tapped mute on the native CallKit UI)
|
|
82
|
-
// are sent here — app-initiated actions are filtered out on the native side to prevent
|
|
83
|
-
// the feedback loop: app mutes mic → setMutedCall → CallKit delegate → event to JS → loop.
|
|
84
|
-
const subscription = callingx.addEventListener('didPerformSetMutedCallAction', async event => {
|
|
85
|
-
const {
|
|
86
|
-
callId,
|
|
87
|
-
muted
|
|
88
|
-
} = event;
|
|
89
|
-
const isCallRegistered = callingx.isCallRegistered(activeCallCid);
|
|
90
|
-
if (!isCallRegistered || callId !== activeCallCid) {
|
|
91
|
-
logger.debug(`No active call cid to set muted in calling exp: ${activeCallCid} isCallRegistered: ${isCallRegistered} callId: ${callId}`);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const isCurrentlyMuted = microphone.state.status === 'disabled';
|
|
95
|
-
if (isCurrentlyMuted === muted) {
|
|
96
|
-
logger.debug(`Mic toggle is already in the desired state: ${muted} for call: ${activeCallCid}`);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
if (muted) {
|
|
101
|
-
await microphone.disable();
|
|
102
|
-
} else {
|
|
103
|
-
await microphone.enable();
|
|
104
|
-
}
|
|
105
|
-
} catch (error) {
|
|
106
|
-
logger.error(`Error toggling mic in calling exp: ${activeCallCid}`, error);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return () => {
|
|
110
|
-
subscription.remove();
|
|
111
|
-
};
|
|
112
|
-
}, [activeCallCid, microphone]);
|
|
113
|
-
};
|
|
114
|
-
//# sourceMappingURL=useCallingExpWithCallingStateEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["videoLoggerSystem","useCall","useCallStateHooks","useEffect","useMemo","getCallDisplayName","getCallingxLibIfAvailable","logger","getLogger","useCallingExpWithCallingStateEffect","useMicrophoneState","useParticipants","useCallMembers","activeCall","isMute","microphone","callMembers","participants","activeCallCid","cid","currentUserId","callDisplayName","callingx","isSetup","isCallRegistered","debug","endCallWithReason","catch","error","updateDisplay","setMutedCall","subscription","addEventListener","event","callId","muted","isCurrentlyMuted","state","status","disable","enable","remove"],"sourceRoot":"../../../../src","sources":["hooks/push/useCallingExpWithCallingStateEffect.ts"],"mappings":"AAAA,SAAuBA,iBAAiB,QAAQ,yBAAyB;AACzE,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,SAAS,EAAEC,OAAO,QAAgB,OAAO;AAClD,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,yBAAyB,QAAQ,gCAAgC;AAE1E,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CACxC,gDACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mCAAmC,GAAGA,CAAA,KAAM;EACvD,MAAM;IAAEC,kBAAkB;IAAEC,eAAe;IAAEC;EAAe,CAAC,GAC3DV,iBAAiB,CAAC,CAAC;EAErB,MAAMW,UAAU,GAAGZ,OAAO,CAAC,CAAC;EAC5B,MAAM;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ACN,aAAa,CAAC;MACjE,IAAI,CAACM,gBAAgB,IAAIU,MAAM,KAAKhB,aAAa,EAAE;QACjDX,MAAM,CAACkB,KAAK,CACV,mDAAmDP,aAAa,sBAAsBM,gBAAgB,YAAYU,MAAM,EAC1H,CAAC;QACD;MACF;MAEA,MAAME,gBAAgB,GAAGrB,UAAU,CAACsB,KAAK,CAACC,MAAM,KAAK,UAAU;MAC/D,IAAIF,gBAAgB,KAAKD,KAAK,EAAE;QAC9B5B,MAAM,CAACkB,KAAK,CACV,+CAA+CU,KAAK,cAAcjB,aAAa,EACjF,CAAC;QACD;MACF;MAEA,IAAI;QACF,IAAIiB,KAAK,EAAE;UACT,MAAMpB,UAAU,CAACwB,OAAO,CAAC,CAAC;QAC5B,CAAC,MAAM;UACL,MAAMxB,UAAU,CAACyB,MAAM,CAAC,CAAC;QAC3B;MACF,CAAC,CAAC,OAAOZ,KAAc,EAAE;QACvBrB,MAAM,CAACqB,KAAK,CACV,sCAAsCV,aAAa,EAAE,EACrDU,KACF,CAAC;MACH;IACF,CACF,CAAC;IAED,OAAO,MAAM;MACXG,YAAY,CAACU,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACvB,aAAa,EAAEH,UAAU,CAAC,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module to manage pending promise for audio session activation.
|
|
3
|
-
* Used to wait for iOS CallKit's didActivateAudioSession event after starting a call.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
let pendingResolve = null;
|
|
7
|
-
let pendingTimeout = null;
|
|
8
|
-
/**
|
|
9
|
-
* Flag to check if the audio session is already activated.
|
|
10
|
-
* This solves race condition for a cold start case, when the audio session is activated before the promise is created.
|
|
11
|
-
*/
|
|
12
|
-
let isAudioSessionAlreadyActivated = false;
|
|
13
|
-
const AUDIO_SESSION_TIMEOUT_MS = 5000;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Creates a promise that resolves when the audio session is activated,
|
|
17
|
-
* or after a timeout to prevent hanging indefinitely.
|
|
18
|
-
* @returns Promise that resolves when audio session is activated or timeout occurs
|
|
19
|
-
*/
|
|
20
|
-
export function waitForAudioSessionActivation() {
|
|
21
|
-
if (isAudioSessionAlreadyActivated) {
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
return new Promise(resolve => {
|
|
25
|
-
pendingResolve = resolve;
|
|
26
|
-
pendingTimeout = setTimeout(() => {
|
|
27
|
-
// Resolve on timeout to prevent hanging
|
|
28
|
-
resolvePendingAudioSession();
|
|
29
|
-
}, AUDIO_SESSION_TIMEOUT_MS);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Resolves the pending audio session activation promise.
|
|
35
|
-
* Called when the didActivateAudioSession event fires or on timeout.
|
|
36
|
-
*/
|
|
37
|
-
export function resolvePendingAudioSession() {
|
|
38
|
-
if (pendingTimeout) {
|
|
39
|
-
clearTimeout(pendingTimeout);
|
|
40
|
-
pendingTimeout = null;
|
|
41
|
-
}
|
|
42
|
-
if (pendingResolve) {
|
|
43
|
-
pendingResolve();
|
|
44
|
-
pendingResolve = null;
|
|
45
|
-
isAudioSessionAlreadyActivated = false;
|
|
46
|
-
} else {
|
|
47
|
-
isAudioSessionAlreadyActivated = true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=audioSessionPromise.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pendingResolve","pendingTimeout","isAudioSessionAlreadyActivated","AUDIO_SESSION_TIMEOUT_MS","waitForAudioSessionActivation","Promise","resolve","setTimeout","resolvePendingAudioSession","clearTimeout"],"sourceRoot":"../../../../src","sources":["utils/internal/audioSessionPromise.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,IAAIA,cAAmC,GAAG,IAAI;AAC9C,IAAIC,cAAoD,GAAG,IAAI;AAC/D;AACA;AACA;AACA;AACA,IAAIC,8BAA8B,GAAG,KAAK;AAE1C,MAAMC,wBAAwB,GAAG,IAAI;;AAErC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAAA,EAAkB;EAC7D,IAAIF,8BAA8B,EAAE;IAClC,OAAOG,OAAO,CAACC,OAAO,CAAC,CAAC;EAC1B;EAEA,OAAO,IAAID,OAAO,CAAEC,OAAO,IAAK;IAC9BN,cAAc,GAAGM,OAAO;IACxBL,cAAc,GAAGM,UAAU,CAAC,MAAM;MAChC;MACAC,0BAA0B,CAAC,CAAC;IAC9B,CAAC,EAAEL,wBAAwB,CAAC;EAC9B,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,0BAA0BA,CAAA,EAAS;EACjD,IAAIP,cAAc,EAAE;IAClBQ,YAAY,CAACR,cAAc,CAAC;IAC5BA,cAAc,GAAG,IAAI;EACvB;EAEA,IAAID,cAAc,EAAE;IAClBA,cAAc,CAAC,CAAC;IAChBA,cAAc,GAAG,IAAI;IACrBE,8BAA8B,GAAG,KAAK;EACxC,CAAC,MAAM;IACLA,8BAA8B,GAAG,IAAI;EACvC;AACF","ignoreList":[]}
|
|
@@ -1,127 +0,0 @@
|
|
|
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 isOutcomingCall = call.ringing && call.isCreatedByMe;
|
|
44
|
-
const isIncomingCall = call.ringing && !call.isCreatedByMe;
|
|
45
|
-
const callDisplayName = getCallDisplayName(call.state.members, call.state.participants, call.currentUserId);
|
|
46
|
-
if (!CallingxModule.isCallRegistered(call.cid) && (isOutcomingCall || !call.ringing && CallingxModule.isOngoingCallsEnabled)) {
|
|
47
|
-
try {
|
|
48
|
-
await CallingxModule.startCall(call.cid,
|
|
49
|
-
// unique id for call
|
|
50
|
-
call.id,
|
|
51
|
-
// phone number for display in dialer (we use call id as phone number)
|
|
52
|
-
callDisplayName,
|
|
53
|
-
// display name for display in call screen
|
|
54
|
-
call.state.settings?.video?.enabled ?? false // is video call?
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
// Wait for audio session activation on iOS only
|
|
58
|
-
if (Platform.OS === 'ios') {
|
|
59
|
-
await waitForAudioSessionActivation();
|
|
60
|
-
}
|
|
61
|
-
CallingxModule.setCurrentCallActive(call.cid);
|
|
62
|
-
} catch (error) {
|
|
63
|
-
videoLoggerSystem.getLogger('startCallingxCall').error(`Error starting call in callingx: ${call.cid}`, error);
|
|
64
|
-
}
|
|
65
|
-
} else if (isIncomingCall) {
|
|
66
|
-
try {
|
|
67
|
-
if (!CallingxModule.isCallRegistered(call.cid)) {
|
|
68
|
-
await CallingxModule.displayIncomingCall(call.cid,
|
|
69
|
-
// unique id for call
|
|
70
|
-
call.id,
|
|
71
|
-
// phone number for display in dialer (we use call id as phone number)
|
|
72
|
-
callDisplayName,
|
|
73
|
-
// display name for display in call screen
|
|
74
|
-
call.state.settings?.video?.enabled ?? false // is video call?
|
|
75
|
-
);
|
|
76
|
-
await waitForDisplayIncomingCall(call.cid);
|
|
77
|
-
} else {
|
|
78
|
-
await CallingxModule.answerIncomingCall(call.cid);
|
|
79
|
-
}
|
|
80
|
-
if (Platform.OS === 'ios') {
|
|
81
|
-
await waitForAudioSessionActivation();
|
|
82
|
-
}
|
|
83
|
-
} catch (error) {
|
|
84
|
-
videoLoggerSystem.getLogger('startCallingxCall').error(`Error displaying incoming call in callingx: ${call.cid}`, error);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export async function endCallingxCall(call) {
|
|
89
|
-
if (!CallingxModule || !CallingxModule.isSetup || !CallingxModule.isCallRegistered(call.cid)) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
await CallingxModule.endCallWithReason(call.cid, 'local');
|
|
94
|
-
} catch (error) {
|
|
95
|
-
videoLoggerSystem.getLogger('endCallingxCall').error(`Error ending call in callingx: ${call.cid}`, error);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const waitForDisplayIncomingCall = (callId, timeoutMs = 5000) => {
|
|
99
|
-
if (!CallingxModule) {
|
|
100
|
-
return Promise.resolve();
|
|
101
|
-
}
|
|
102
|
-
return new Promise((resolve, reject) => {
|
|
103
|
-
let timeoutId = undefined;
|
|
104
|
-
let subscription = undefined;
|
|
105
|
-
const cleanup = () => {
|
|
106
|
-
if (timeoutId) {
|
|
107
|
-
clearTimeout(timeoutId);
|
|
108
|
-
}
|
|
109
|
-
subscription?.remove();
|
|
110
|
-
};
|
|
111
|
-
subscription = CallingxModule.addEventListener('didDisplayIncomingCall', async params => {
|
|
112
|
-
videoLoggerSystem.getLogger('waitForDisplayIncomingCall').debug('didDisplayIncomingCall', params);
|
|
113
|
-
cleanup();
|
|
114
|
-
try {
|
|
115
|
-
await CallingxModule.answerIncomingCall(callId);
|
|
116
|
-
resolve();
|
|
117
|
-
} catch (error) {
|
|
118
|
-
reject(error);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
timeoutId = setTimeout(() => {
|
|
122
|
-
cleanup();
|
|
123
|
-
reject(new Error(`Timeout waiting for didDisplayIncomingCall after ${timeoutMs}ms`));
|
|
124
|
-
}, timeoutMs);
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=callingx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","isOutcomingCall","ringing","isCreatedByMe","isIncomingCall","callDisplayName","state","members","isCallRegistered","cid","isOngoingCallsEnabled","startCall","settings","video","enabled","OS","setCurrentCallActive","error","getLogger","displayIncomingCall","waitForDisplayIncomingCall","answerIncomingCall","endCallingxCall","endCallWithReason","callId","timeoutMs","Promise","resolve","reject","timeoutId","subscription","cleanup","clearTimeout","remove","addEventListener","params","debug","setTimeout","Error"],"sourceRoot":"../../../../src","sources":["utils/internal/callingx.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,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,KAAKC,SAAS,CAAC;EACzD,CAAC,MAAM,IAAIV,YAAY,CAACG,MAAM,GAAG,CAAC,EAAE;IAClC;IACAD,KAAK,GAAGF,YAAY,CACjBI,MAAM,CAAEO,WAAW,IAAKA,WAAW,CAACC,MAAM,KAAKX,aAAa,CAAC,CAC7DO,GAAG,CAAEG,WAAW,IAAKA,WAAW,CAACF,IAAI,CAAC,CACtCL,MAAM,CAACS,OAAO,CAAC;EACpB;;EAEA;EACA,IAAIX,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACtBD,KAAK,GAAG,CACNF,YAAY,CAACc,IAAI,CAAEH,WAAW,IAAKA,WAAW,CAACC,MAAM,KAAKX,aAAa,CAAC,EACpEQ,IAA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,0BAA0B,GAAGA,CACjCI,MAAc,EACdC,SAAiB,GAAG,IAAI,KACN;EAClB,IAAI,CAAC/C,cAAc,EAAE;IACnB,OAAOgD,OAAO,CAACC,OAAO,CAAC,CAAC;EAC1B;EAEA,OAAO,IAAID,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,IAAIC,SAAoD,GAAGtC,SAAS;IACpE,IAAIuC,YAES,GAAGvC,SAAS;IAEzB,MAAMwC,OAAO,GAAGA,CAAA,KAAM;MACpB,IAAIF,SAAS,EAAE;QACbG,YAAY,CAACH,SAAS,CAAC;MACzB;MACAC,YAAY,EAAEG,MAAM,CAAC,CAAC;IACxB,CAAC;IAEDH,YAAY,GAAGpD,cAAc,CAACwD,gBAAgB,CAC5C,wBAAwB,EACxB,MAAOC,MAAM,IAAK;MAChB3D,iBAAiB,CACd0C,SAAS,CAAC,4BAA4B,CAAC,CACvCkB,KAAK,CAAC,wBAAwB,EAAED,MAAM,CAAC;MAC1CJ,OAAO,CAAC,CAAC;MAET,IAAI;QACF,MAAMrD,cAAc,CAAC2C,kBAAkB,CAACG,MAAM,CAAC;QAC/CG,OAAO,CAAC,CAAC;MACX,CAAC,CAAC,OAAOV,KAAK,EAAE;QACdW,MAAM,CAACX,KAAK,CAAC;MACf;IACF,CACF,CAAC;IAEDY,SAAS,GAAGQ,UAAU,CAAC,MAAM;MAC3BN,OAAO,CAAC,CAAC;MACTH,MAAM,CACJ,IAAIU,KAAK,CACP,oDAAoDb,SAAS,IAC/D,CACF,CAAC;IACH,CAAC,EAAEA,SAAS,CAAC;EACf,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,kEAAkE,EAClE;QAAEF;MAAQ,CACZ,CAAC;MACD;IACF;IACA,IAAIA,OAAO,IAAIC,IAAI,CAACE,GAAG,IAAIF,IAAI,CAACE,GAAG,KAAKH,OAAO,EAAE;MAC/CF,MAAM,CAACI,IAAI,CACT,+DAA+D,EAC/D;QAAEF,OAAO;QAAEI,aAAa,EAAEH,IAAI,CAACE;MAAI,CACrC,CAAC;MACD;IACF;IAEA,MAAME,MAAM,GAAGhB,aAAa,CAACiB,SAAS,CAAC,CAAC;IACxC,MAAMC,SAAS,GAAGF,MAAM,CAACG,iBAAiB,CAACC,OAAO,CAACF,SAAS;IAC5D,IAAI;MACF,MAAMA,SAAS,CAACN,IAAI,CAAC;IACvB,CAAC,CAAC,OAAOS,CAAC,EAAE;MACVZ,MAAM,CAACa,KAAK,CAAC,iCAAiC,EAAED,CAAC,CAAC;IACpD;EACF,CACF,CAAC;AACH;AAEAhB,qCAAqC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
let callingx;
|
|
2
|
-
try {
|
|
3
|
-
callingx = require('@stream-io/react-native-callingx').CallingxModule;
|
|
4
|
-
} catch {}
|
|
5
|
-
export function getCallingxLib() {
|
|
6
|
-
if (!callingx) {
|
|
7
|
-
throw Error('react-native-callingx library is not installed.');
|
|
8
|
-
}
|
|
9
|
-
return callingx;
|
|
10
|
-
}
|
|
11
|
-
export function getCallingxLibIfAvailable() {
|
|
12
|
-
return callingx ?? undefined;
|
|
13
|
-
}
|
|
14
|
-
export function extractCallingExpOptions(config) {
|
|
15
|
-
const {
|
|
16
|
-
push: pushConfig,
|
|
17
|
-
foregroundService: foregroundServiceConfig
|
|
18
|
-
} = config;
|
|
19
|
-
const callingExpOptions = {};
|
|
20
|
-
if (pushConfig?.ios) {
|
|
21
|
-
const iosOptions = {};
|
|
22
|
-
if (pushConfig.ios.supportsVideo !== undefined) {
|
|
23
|
-
iosOptions.supportsVideo = pushConfig.ios.supportsVideo;
|
|
24
|
-
}
|
|
25
|
-
if (pushConfig.ios.sound !== undefined) {
|
|
26
|
-
iosOptions.sound = pushConfig.ios.sound;
|
|
27
|
-
}
|
|
28
|
-
if (pushConfig.ios.imageName !== undefined) {
|
|
29
|
-
iosOptions.imageName = pushConfig.ios.imageName;
|
|
30
|
-
}
|
|
31
|
-
if (pushConfig.ios.callsHistory !== undefined) {
|
|
32
|
-
iosOptions.callsHistory = pushConfig.ios.callsHistory;
|
|
33
|
-
}
|
|
34
|
-
if (pushConfig.ios.displayCallTimeout !== undefined) {
|
|
35
|
-
iosOptions.displayCallTimeout = pushConfig.ios.displayCallTimeout;
|
|
36
|
-
}
|
|
37
|
-
if (Object.keys(iosOptions).length > 0) {
|
|
38
|
-
callingExpOptions.ios = iosOptions;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const androidOptions = {};
|
|
42
|
-
if (pushConfig?.android) {
|
|
43
|
-
if (pushConfig.android.incomingChannel) {
|
|
44
|
-
androidOptions.incomingChannel = pushConfig.android.incomingChannel;
|
|
45
|
-
}
|
|
46
|
-
if (pushConfig.android.titleTransformer) {
|
|
47
|
-
androidOptions.titleTransformer = pushConfig.android.titleTransformer;
|
|
48
|
-
}
|
|
49
|
-
if (pushConfig.android.subtitleTransformer) {
|
|
50
|
-
androidOptions.subtitleTransformer = pushConfig.android.subtitleTransformer;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (foregroundServiceConfig.android.channel) {
|
|
54
|
-
androidOptions.ongoingChannel = foregroundServiceConfig.android.channel;
|
|
55
|
-
}
|
|
56
|
-
if (Object.keys(androidOptions).length > 0) {
|
|
57
|
-
callingExpOptions.android = androidOptions;
|
|
58
|
-
}
|
|
59
|
-
if (pushConfig?.shouldRejectCallWhenBusy !== undefined) {
|
|
60
|
-
callingExpOptions.shouldRejectCallWhenBusy = pushConfig.shouldRejectCallWhenBusy;
|
|
61
|
-
}
|
|
62
|
-
if (pushConfig?.enableOngoingCalls !== undefined) {
|
|
63
|
-
callingExpOptions.enableOngoingCalls = pushConfig?.enableOngoingCalls;
|
|
64
|
-
}
|
|
65
|
-
return callingExpOptions;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=callingx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["callingx","require","CallingxModule","getCallingxLib","Error","getCallingxLibIfAvailable","undefined","extractCallingExpOptions","config","push","pushConfig","foregroundService","foregroundServiceConfig","callingExpOptions","ios","iosOptions","supportsVideo","sound","imageName","callsHistory","displayCallTimeout","Object","keys","length","androidOptions","android","incomingChannel","titleTransformer","subtitleTransformer","channel","ongoingChannel","shouldRejectCallWhenBusy","enableOngoingCalls"],"sourceRoot":"../../../../../src","sources":["ut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