@stream-io/video-react-native-sdk 1.29.3 → 1.29.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +52 -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 +151 -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/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 +52 -3
- 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 +153 -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/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 +14 -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/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/StreamInCallManager.m +2 -0
- package/ios/StreamInCallManager.swift +19 -7
- package/ios/StreamVideoReactNative.h +7 -4
- package/ios/StreamVideoReactNative.m +189 -82
- package/package.json +13 -18
- 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 +47 -4
- package/src/utils/keepCallAliveHeadlessTask.ts +54 -0
- package/src/utils/push/android.ts +227 -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 -3144
- 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
|
@@ -4,48 +4,4 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
4
4
|
* Note: it is should be subscribed only when a user has connected to the websocket of Stream
|
|
5
5
|
*/
|
|
6
6
|
export const pushNonRingingCallData$ = new BehaviorSubject(undefined);
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This rxjs subject is used to store the call cid of the accepted incoming call from push notification
|
|
10
|
-
* Note: it is should be subscribed only when a user has connected to the websocket of Stream
|
|
11
|
-
*/
|
|
12
|
-
export const pushAcceptedIncomingCallCId$ = new BehaviorSubject(undefined);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* This rxjs subject is used to store the call cid of the tapped incoming call from push notification it is neither accepted nor rejected yet
|
|
16
|
-
* Note: it should be subscribed only when a user has connected to the websocket of Stream
|
|
17
|
-
*/
|
|
18
|
-
export const pushTappedIncomingCallCId$ = new BehaviorSubject(undefined);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This rxjs subject is used to store the call cid of the delivered incoming call from push notification it is neither accepted nor rejected yet
|
|
22
|
-
* Used so that the call is navigated to when app is open from being killed
|
|
23
|
-
* Note: it should be subscribed only when a user has connected to the websocket of Stream
|
|
24
|
-
*/
|
|
25
|
-
export const pushAndroidBackgroundDeliveredIncomingCallCId$ = new BehaviorSubject(undefined);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* This rxjs subject is used to store the call cid of the accepted incoming call from push notification
|
|
29
|
-
* Note: it should be subscribed only when a user has connected to the websocket of Stream
|
|
30
|
-
*/
|
|
31
|
-
export const pushRejectedIncomingCallCId$ = new BehaviorSubject(undefined);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* This rxjs subject is used to store the call cid of the incoming call from ios voip pushkit notification
|
|
35
|
-
*/
|
|
36
|
-
export const voipPushNotificationCallCId$ = new BehaviorSubject(undefined);
|
|
37
|
-
|
|
38
|
-
/** The pair of cid of a call and its corresponding uuid created in the native side */
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
* This rxjs subject should only used to store the CallkeepMap
|
|
42
|
-
* for the incoming call when on foreground
|
|
43
|
-
* or in other words, when we get didDisplayIncomingCall from callkeep lib
|
|
44
|
-
*/
|
|
45
|
-
export const voipCallkeepCallOnForegroundMap$ = new BehaviorSubject(undefined);
|
|
46
|
-
|
|
47
|
-
/*
|
|
48
|
-
* This rxjs subject should only used to store the CallkeepMap when it was accepted in the native dialer
|
|
49
|
-
*/
|
|
50
|
-
export const voipCallkeepAcceptedCallOnNativeDialerMap$ = new BehaviorSubject(undefined);
|
|
51
7
|
//# sourceMappingURL=rxSubjects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined"
|
|
1
|
+
{"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,MAAM;AAGtC;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAID,eAAe,CAExDE,SAAS,CAAC","ignoreList":[]}
|
|
@@ -1,47 +1,40 @@
|
|
|
1
1
|
import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
2
2
|
import { onNewCallNotification } from '../../internal/newNotificationCallbacks';
|
|
3
3
|
import { pushUnsubscriptionCallbacks } from './constants';
|
|
4
|
+
import { AppState } from 'react-native';
|
|
4
5
|
/**
|
|
5
6
|
* This function is used to check if the call should be ended based on the push notification
|
|
6
7
|
* Useful for callkeep management to end the call if necessary (with reportEndCallWithUUID)
|
|
7
8
|
*/
|
|
8
9
|
export const shouldCallBeEnded = (callFromPush, created_by_id, receiver_id) => {
|
|
9
|
-
/* callkeep reasons for ending a call
|
|
10
|
-
FAILED: 1,
|
|
11
|
-
REMOTE_ENDED: 2,
|
|
12
|
-
UNANSWERED: 3,
|
|
13
|
-
ANSWERED_ELSEWHERE: 4,
|
|
14
|
-
DECLINED_ELSEWHERE: 5,
|
|
15
|
-
MISSED: 6
|
|
16
|
-
*/
|
|
17
10
|
const callSession = callFromPush.state.session;
|
|
18
11
|
const rejected_by = callSession?.rejected_by;
|
|
19
12
|
const accepted_by = callSession?.accepted_by;
|
|
20
13
|
let mustEndCall = false;
|
|
21
|
-
let
|
|
14
|
+
let endCallReason = 'unknown';
|
|
22
15
|
if (created_by_id && rejected_by) {
|
|
23
16
|
if (rejected_by[created_by_id]) {
|
|
24
|
-
// call was cancelled by the caller
|
|
17
|
+
// call was cancelled by the caller before the receiver could answer
|
|
25
18
|
mustEndCall = true;
|
|
26
|
-
|
|
19
|
+
endCallReason = 'canceled';
|
|
27
20
|
}
|
|
28
21
|
} else if (receiver_id && rejected_by) {
|
|
29
22
|
if (rejected_by[receiver_id]) {
|
|
30
23
|
// call was rejected by the receiver in some other device
|
|
31
24
|
mustEndCall = true;
|
|
32
|
-
|
|
25
|
+
endCallReason = 'rejected';
|
|
33
26
|
}
|
|
34
27
|
} else if (receiver_id && accepted_by) {
|
|
35
28
|
if (accepted_by[receiver_id]) {
|
|
36
29
|
// call was accepted by the receiver in some other device
|
|
37
30
|
mustEndCall = true;
|
|
38
|
-
|
|
31
|
+
endCallReason = 'answeredElsewhere';
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
|
-
videoLoggerSystem.getLogger('shouldCallBeEnded').debug(`callCid: ${callFromPush.cid} mustEndCall: ${mustEndCall}
|
|
34
|
+
videoLoggerSystem.getLogger('shouldCallBeEnded').debug(`callCid: ${callFromPush.cid} mustEndCall: ${mustEndCall} endCallReason: ${endCallReason}`);
|
|
42
35
|
return {
|
|
43
36
|
mustEndCall,
|
|
44
|
-
|
|
37
|
+
endCallReason
|
|
45
38
|
};
|
|
46
39
|
};
|
|
47
40
|
|
|
@@ -73,10 +66,10 @@ export const processCallFromPushInBackground = async (pushConfig, call_cid, acti
|
|
|
73
66
|
*/
|
|
74
67
|
export const processCallFromPush = async (client, call_cid, action, pushConfig) => {
|
|
75
68
|
let callFromPush;
|
|
69
|
+
const logger = videoLoggerSystem.getLogger('Callingx - processCallFromPush');
|
|
76
70
|
try {
|
|
77
71
|
callFromPush = await client.onRingingCall(call_cid);
|
|
78
72
|
} catch (e) {
|
|
79
|
-
const logger = videoLoggerSystem.getLogger('processCallFromPush');
|
|
80
73
|
logger.error('failed to fetch call from push notification', e);
|
|
81
74
|
return;
|
|
82
75
|
}
|
|
@@ -86,18 +79,22 @@ export const processCallFromPush = async (client, call_cid, action, pushConfig)
|
|
|
86
79
|
if (pushConfig.publishOptions) {
|
|
87
80
|
callFromPush.updatePublishOptions(pushConfig.publishOptions);
|
|
88
81
|
}
|
|
89
|
-
|
|
82
|
+
logger.debug(`joining call from push notification with callCid: ${callFromPush.cid}`);
|
|
83
|
+
const callingState = callFromPush.state.callingState;
|
|
84
|
+
if (callingState !== CallingState.RINGING && callingState !== CallingState.IDLE) {
|
|
85
|
+
logger.debug(`skipping join call as it is not in ringing or idle state from push notification. callCid: ${callFromPush.cid}`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
90
88
|
await callFromPush.join();
|
|
91
89
|
} else if (action === 'decline') {
|
|
92
90
|
const canReject = callFromPush.state.callingState === CallingState.RINGING;
|
|
93
|
-
|
|
91
|
+
logger.debug(`declining call from push notification with callCid: ${callFromPush.cid} reject: ${canReject}`);
|
|
94
92
|
await callFromPush.leave({
|
|
95
93
|
reject: canReject,
|
|
96
94
|
reason: 'decline'
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
97
|
} catch (e) {
|
|
100
|
-
const logger = videoLoggerSystem.getLogger('processCallFromPush');
|
|
101
98
|
logger.warn(`failed to process ${action} call from push notification`, e);
|
|
102
99
|
}
|
|
103
100
|
};
|
|
@@ -148,4 +145,17 @@ export const clearPushWSEventSubscriptions = call_cid => {
|
|
|
148
145
|
export const canAddPushWSSubscriptionsRef = {
|
|
149
146
|
current: true
|
|
150
147
|
};
|
|
148
|
+
export const canListenToWS = () => canAddPushWSSubscriptionsRef.current && AppState.currentState !== 'active';
|
|
149
|
+
export const shouldCallBeClosed = (call, pushData) => {
|
|
150
|
+
const created_by_id = pushData?.created_by_id;
|
|
151
|
+
const receiver_id = pushData?.receiver_id;
|
|
152
|
+
const {
|
|
153
|
+
mustEndCall,
|
|
154
|
+
endCallReason
|
|
155
|
+
} = shouldCallBeEnded(call, created_by_id, receiver_id);
|
|
156
|
+
return {
|
|
157
|
+
mustEndCall,
|
|
158
|
+
endCallReason
|
|
159
|
+
};
|
|
160
|
+
};
|
|
151
161
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CallingState","videoLoggerSystem","onNewCallNotification","pushUnsubscriptionCallbacks","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","
|
|
1
|
+
{"version":3,"names":["CallingState","videoLoggerSystem","onNewCallNotification","pushUnsubscriptionCallbacks","AppState","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","endCallReason","getLogger","debug","cid","processCallFromPushInBackground","pushConfig","call_cid","action","videoClient","createStreamVideoClient","e","logger","error","processCallFromPush","client","onRingingCall","publishOptions","updatePublishOptions","callingState","RINGING","IDLE","join","canReject","leave","reject","reason","warn","processNonIncomingCallFromPush","nonRingingNotificationType","_callFromPush","calls","find","c","callType","callId","split","call","get","clearPushWSEventSubscriptions","unsubscriptionCallbacks","forEach","cb","delete","canAddPushWSSubscriptionsRef","current","canListenToWS","currentState","shouldCallBeClosed","pushData"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":"AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAKhC,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,2BAA2B,QAAQ,aAAa;AACzD,SAASC,QAAQ,QAAQ,cAAc;AAOvC;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,YAAkB,EAClBC,aAAiC,EACjCC,WAA+B,KAC5B;EACH,MAAMC,WAAW,GAAGH,YAAY,CAACI,KAAK,CAACC,OAAO;EAC9C,MAAMC,WAAW,GAAGH,WAAW,EAAEG,WAAW;EAC5C,MAAMC,WAAW,GAAGJ,WAAW,EAAEI,WAAW;EAC5C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,aAA4B,GAAG,SAAS;EAE5C,IAAIR,aAAa,IAAIK,WAAW,EAAE;IAChC,IAAIA,WAAW,CAACL,aAAa,CAAC,EAAE;MAC9B;MACAO,WAAW,GAAG,IAAI;MAClBC,aAAa,GAAG,UAAU;IAC5B;EACF,CAAC,MAAM,IAAIP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KAAK,QAAQ;AAE5E,OAAO,MAAMC,kBAAkB,GAAGA,CAChCX,IAAU,EACVY,QAA4C,KACzC;EACH,MAAMxD,aAAa,GAAGwD,QAAQ,EAAExD,aAAuB;EACvD,MAAMC,WAAW,GAAGuD,QAAQ,EAAEvD,WAAqB;EAEnD,MAAM;IAAEM,WAAW;IAAEC;EAAc,CAAC,GAAGV,iBAAiB,CACtD8C,IAAI,EACJ5C,aAAa,EACbC,WACF,CAAC;EACD,OAAO;IAAEM,WAAW;IAAEC;EAAc,CAAC;AACvC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","pushNonRingingCallData$","getExpoNotificationsLib","getNotifeeLibThrowIfNotInstalledForPush","getPushNotificationIosLib","videoLoggerSystem","setPushLogoutCallback","StreamVideoRN","lastApnToken","token","userId","processNonRingingNotificationStreamPayload","streamPayload","sender","type","cid","call_cid","logger","getLogger","trace","next","undefined","oniOSExpoNotificationEvent","event","pushConfig","getConfig","push","trigger","request","payload","stream","JSON","stringify","oniOSNotifeeEvent","OS","detail","notifeeLib","EventType","PRESS","notification","data","result","debug","onTapNonRingingCallNotification","onPushNotificationiOSStreamVideoEvent","pushNotificationIosLib","getData","isClicked","userInteraction","finish","FetchResult","NoData","initIosNonVoipToken","client","setUnsubscribeListener","ios","pushProviderName","setDeviceToken","streamClient","_user","id","removeDevice","err","warn","push_provider_name","addDevice","then","catch","isExpo","expoNotificationsLib","getDevicePushTokenAsync","devicePushToken","subscription","addPushTokenListener","remove","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["utils/push/ios.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAEEC,uBAAuB,EACvBC,uCAAuC,EACvCC,yBAAyB,QAEpB,QAAQ;AACf,SAA4BC,iBAAiB,QAAQ,yBAAyB;AAC9E,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,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ACF,CAAC;AAED,OAAO,MAAMqB,iBAAiB,GAAGA,CAAC;
|
|
1
|
+
{"version":3,"names":["Platform","pushNonRingingCallData$","getExpoNotificationsLib","getNotifeeLibThrowIfNotInstalledForPush","getPushNotificationIosLib","videoLoggerSystem","setPushLogoutCallback","StreamVideoRN","lastApnToken","token","userId","processNonRingingNotificationStreamPayload","streamPayload","sender","type","cid","call_cid","logger","getLogger","trace","next","undefined","oniOSExpoNotificationEvent","event","pushConfig","getConfig","push","trigger","request","payload","stream","JSON","stringify","oniOSNotifeeEvent","OS","detail","notifeeLib","EventType","PRESS","notification","data","result","debug","onTapNonRingingCallNotification","onPushNotificationiOSStreamVideoEvent","pushNotificationIosLib","getData","isClicked","userInteraction","finish","FetchResult","NoData","initIosNonVoipToken","client","setUnsubscribeListener","ios","pushProviderName","setDeviceToken","streamClient","_user","id","removeDevice","err","warn","push_provider_name","addDevice","then","catch","isExpo","expoNotificationsLib","getDevicePushTokenAsync","devicePushToken","subscription","addPushTokenListener","remove","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["utils/push/ios.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAEEC,uBAAuB,EACvBC,uCAAuC,EACvCC,yBAAyB,QAEpB,QAAQ;AACf,SAA4BC,iBAAiB,QAAQ,yBAAyB;AAC9E,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,aAAa,QAAQ,kBAAkB;AAKhD,IAAIC,YAAY,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC;AAE5C,SAASC,0CAA0CA,CACjDC,aAAgC,EAChC;EACA,IACEA,aAAa,EAAEC,MAAM,KAAK,cAAc,IACxCD,aAAa,EAAEE,IAAI,KAAK,WAAW,EACnC;IACA,MAAMC,GAAG,GAAGH,aAAa,CAACI,QAAQ;IAClC,MAAMF,IAAI,GAAGF,aAAa,CAACE,IA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GzC,yBAAyB,CAAC,CAAC;IAC1DyC,sBAAsB,CAAC8B,gBAAgB,CAAC,UAAU,EAAGlE,KAAK,IAAK;MAC7DQ,MAAM,CAACyB,KAAK,CACV,wEAAwE,EACxEjC,KACF,CAAC;MACDgD,cAAc,CAAChD,KAAK,CAAC;IACvB,CAAC,CAAC;IACF6C,sBAAsB,CAAC,MAAM;MAC3BrC,MAAM,CAACyB,KAAK,CAAC,wDAAwD,CAAC;MACtEG,sBAAsB,CAAC+B,mBAAmB,CAAC,UAAU,CAAC;IACxD,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;AAET,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAI,CAACH,QAAQ,EAAE;IACb,MAAMI,KAAK,CAAC,iDAAiD,CAAC;EAChE;EACA,OAAOJ,QAAQ;AACjB;AAEA,OAAO,SAASK,yBAAyBA,CAAA,EAAG;EAC1C,OAAOL,QAAQ,IAAIM,SAAS;AAC9B;AAEA,OAAO,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,EAAE;MAC1CS,UAAU,CAACG,SAAS,GAAGR,UAAU,CAACI,GAAG,CAACI,SA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AwB;EACvC;EAEA,IAAIrB,UAAU,EAAEsB,kBAAkB,KAAK1B,SAAS,EAAE;IAChDO,iBAAiB,CAACmB,kBAAkB,GAAGtB,UAAU,EAAEsB,kBAAkB;EACvE;EAEA,OAAOnB,iBAAiB;AAC1B","ignoreList":[]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './expoNotifications';
|
|
2
2
|
export * from './firebaseMessaging';
|
|
3
3
|
export * from './iosPushNotification';
|
|
4
|
-
export * from './voipPushNotification';
|
|
5
|
-
export * from './callkeep';
|
|
6
4
|
export * from './notifee';
|
|
5
|
+
export * from './callingx';
|
|
7
6
|
|
|
8
7
|
/*
|
|
9
8
|
NOTE: must keep each libs in different files
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["utils/push/libs/index.ts"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["utils/push/libs/index.ts"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,WAAW;AACzB,cAAc,YAAY;;AAE1B;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { PermissionsAndroid } from 'react-native';
|
|
2
1
|
import { lib } from './lib';
|
|
3
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
4
2
|
var AndroidForegroundServiceType = /*#__PURE__*/function (AndroidForegroundServiceType) {
|
|
5
3
|
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CAMERA"] = 64] = "FOREGROUND_SERVICE_TYPE_CAMERA";
|
|
6
4
|
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE"] = 16] = "FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE";
|
|
@@ -27,24 +25,8 @@ export function getNotifeeLibThrowIfNotInstalledForPush() {
|
|
|
27
25
|
return lib;
|
|
28
26
|
}
|
|
29
27
|
export function getNotifeeLibNoThrowForKeepCallAlive() {
|
|
30
|
-
if (!lib) {
|
|
31
|
-
const logger = videoLoggerSystem.getLogger('getNotifeeLibNoThrow');
|
|
32
|
-
logger.info(`${'@notifee/react-native library not installed. It is required to keep call alive in the background for Android. '}${INSTALLATION_INSTRUCTION}`);
|
|
33
|
-
}
|
|
34
28
|
return lib;
|
|
35
29
|
}
|
|
36
|
-
export async function getKeepCallAliveForegroundServiceTypes() {
|
|
37
|
-
const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK];
|
|
38
|
-
const hasCameraPermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA);
|
|
39
|
-
if (hasCameraPermission) {
|
|
40
|
-
types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_CAMERA);
|
|
41
|
-
}
|
|
42
|
-
const hasMicrophonePermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
|
|
43
|
-
if (hasMicrophonePermission) {
|
|
44
|
-
types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_MICROPHONE);
|
|
45
|
-
}
|
|
46
|
-
return types;
|
|
47
|
-
}
|
|
48
30
|
export function getIncomingCallForegroundServiceTypes() {
|
|
49
31
|
const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE];
|
|
50
32
|
return types;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["lib","AndroidForegroundServiceType","INSTALLATION_INSTRUCTION","getNotifeeLibThrowIfNotInstalledForPush","Error","getNotifeeLibNoThrowForKeepCallAlive","getIncomingCallForegroundServiceTypes","types","FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/index.ts"],"mappings":"AAAA,SAASA,GAAG,QAAmB,OAAO;AAAC,IAIlCC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA,EAA5BA,4BAA4B;AAkBjC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAE/F,OAAO,SAASC,uCAAuCA,CAAA,EAAG;EACxD,IAAI,CAACH,GAAG,EAAE;IACR,MAAMI,KAAK,CACT,8FAA8F,GAC5FF,wBACJ,CAAC;EACH;EACA,OAAOF,GAAG;AACZ;AAEA,OAAO,SAASK,oCAAoCA,CAAA,EAAG;EACrD,OAAOL,GAAG;AACZ;AAEA,OAAO,SAASM,qCAAqCA,CAAA,EAAG;EACtD,MAAMC,KAAqC,GAAG,CAC5CN,4BAA4B,CAACO,qCAAqC,CACnE;EACD,OAAOD,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
2
|
+
import { clearPushWSEventSubscriptions, processCallFromPushInBackground } from './internal/utils';
|
|
3
|
+
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
4
|
+
import { resolvePendingAudioSession } from '../internal/callingx/audioSessionPromise';
|
|
5
|
+
import { getCallingxLib } from './libs/callingx';
|
|
6
|
+
import { Platform } from 'react-native';
|
|
7
|
+
const logger = videoLoggerSystem.getLogger('callingx');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Sets up callingx event listeners for handling call actions from the native calling UI.
|
|
11
|
+
*/
|
|
12
|
+
export function setupCallingExpEvents(pushConfig) {
|
|
13
|
+
const hasPushProvider = Platform.OS === 'android' && pushConfig.android?.pushProviderName || Platform.OS === 'ios' && pushConfig.ios?.pushProviderName;
|
|
14
|
+
if (!hasPushProvider) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const callingx = getCallingxLib();
|
|
18
|
+
const {
|
|
19
|
+
remove: removeAnswerCall
|
|
20
|
+
} = callingx.addEventListener('answerCall', params => {
|
|
21
|
+
onAcceptCall(pushConfig)(params).catch(err => {
|
|
22
|
+
logger.error('Failed to process answerCall event', err);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
const {
|
|
26
|
+
remove: removeEndCall
|
|
27
|
+
} = callingx.addEventListener('endCall', params => {
|
|
28
|
+
onEndCall(pushConfig)(params).catch(err => {
|
|
29
|
+
logger.error('Failed to process endCall event', err);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
const {
|
|
33
|
+
remove: removeDidActivateAudioSession
|
|
34
|
+
} = callingx.addEventListener('didActivateAudioSession', onDidActivateAudioSession);
|
|
35
|
+
const {
|
|
36
|
+
remove: removeDidDeactivateAudioSession
|
|
37
|
+
} = callingx.addEventListener('didDeactivateAudioSession', onDidDeactivateAudioSession);
|
|
38
|
+
|
|
39
|
+
//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
|
|
40
|
+
//in most cases there will be no delayed answers or ends, but it we don't want to miss any of them
|
|
41
|
+
const events = callingx.getInitialEvents();
|
|
42
|
+
events.forEach(event => {
|
|
43
|
+
const {
|
|
44
|
+
eventName,
|
|
45
|
+
params
|
|
46
|
+
} = event;
|
|
47
|
+
if (eventName === 'answerCall') {
|
|
48
|
+
logger.debug(`answerCall delayed event callId: ${params?.callId}`);
|
|
49
|
+
onAcceptCall(pushConfig)(params).catch(err => {
|
|
50
|
+
logger.error('Failed to process delayed answerCall event', err);
|
|
51
|
+
});
|
|
52
|
+
} else if (eventName === 'endCall') {
|
|
53
|
+
logger.debug(`endCall delayed event callId: ${params?.callId}`);
|
|
54
|
+
onEndCall(pushConfig)(params).catch(err => {
|
|
55
|
+
logger.error('Failed to process delayed endCall event', err);
|
|
56
|
+
});
|
|
57
|
+
} else if (eventName === 'didActivateAudioSession') {
|
|
58
|
+
onDidActivateAudioSession();
|
|
59
|
+
} else if (eventName === 'didDeactivateAudioSession') {
|
|
60
|
+
onDidDeactivateAudioSession();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
setPushLogoutCallback(async () => {
|
|
64
|
+
removeAnswerCall();
|
|
65
|
+
removeEndCall();
|
|
66
|
+
removeDidActivateAudioSession();
|
|
67
|
+
removeDidDeactivateAudioSession();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const onDidActivateAudioSession = () => {
|
|
71
|
+
logger.debug('callingExpDidActivateAudioSession');
|
|
72
|
+
resolvePendingAudioSession();
|
|
73
|
+
};
|
|
74
|
+
const onDidDeactivateAudioSession = () => {
|
|
75
|
+
logger.debug('callingExpDidDeactivateAudioSession');
|
|
76
|
+
};
|
|
77
|
+
const onAcceptCall = pushConfig => async ({
|
|
78
|
+
callId: call_cid,
|
|
79
|
+
source
|
|
80
|
+
}) => {
|
|
81
|
+
logger.debug(`onAcceptCall event callId: ${call_cid} source: ${source}`);
|
|
82
|
+
if (source === 'app' || !call_cid) {
|
|
83
|
+
//we only need to process the call if the call was answered from the system
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
87
|
+
// to process the call in the app
|
|
88
|
+
await processCallFromPushInBackground(pushConfig, call_cid, 'accept');
|
|
89
|
+
};
|
|
90
|
+
const onEndCall = pushConfig => async ({
|
|
91
|
+
callId: call_cid,
|
|
92
|
+
source
|
|
93
|
+
}) => {
|
|
94
|
+
logger.debug(`onEndCall event callId: ${call_cid} source: ${source}`);
|
|
95
|
+
if (source === 'app' || !call_cid) {
|
|
96
|
+
//we only need to process the call if the call was rejected from the system
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
100
|
+
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=setupCallingExpEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["videoLoggerSystem","clearPushWSEventSubscriptions","processCallFromPushInBackground","setPushLogoutCallback","resolvePendingAudioSession","getCallingxLib","Platform","logger","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","OS","android","pushProviderName","ios","callingx","remove","removeAnswerCall","addEventListener","params","onAcceptCall","catch","err","error","removeEndCall","onEndCall","removeDidActivateAudioSession","onDidActivateAudioSession","removeDidDeactivateAudioSession","onDidDeactivateAudioSession","events","getInitialEvents","forEach","event","eventName","debug","callId","call_cid","source"],"sourceRoot":"../../../../src","sources":["utils/push/setupCallingExpEvents.ts"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAyB;AAE3D,SACEC,6BAA6B,EAC7BC,+BAA+B,QAC1B,kBAAkB;AACzB,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,0BAA0B,QAAQ,0CAA0C;AACrF,SACEC,cAAc,QAGT,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,cAAc;AAIvC,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CAAC,UAAU,CAAC;;AAEtD;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,UAAmC,EAAE;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EhC,MAAM,CAAC6B,KAAK,CAAC,8BAA8BE,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAExE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEArC,6BAA6B,CAACqC,QAAQ,CAAC;EACvC;EACA,MAAMpC,+BAA+B,CAACQ,UAAU,EAAE4B,QAAQ,EAAE,QAAQ,CAAC;AACvE,CAAC;AAEH,MAAMZ,SAAS,GACZhB,UAAsB,IACvB,OAAO;EAAE2B,MAAM,EAAEC,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EAC9DhC,MAAM,CAAC6B,KAAK,CAAC,2BAA2BE,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAErE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEArC,6BAA6B,CAACqC,QAAQ,CAAC;EAEvC,MAAMpC,+BAA+B,CAACQ,UAAU,EAAE4B,QAAQ,EAAE,SAAS,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { getVoipPushNotificationLib } from './libs';
|
|
1
|
+
// import { getVoipPushNotificationLib } from './libs';
|
|
2
|
+
|
|
2
3
|
import { Platform } from 'react-native';
|
|
3
4
|
import { onVoipNotificationReceived } from './internal/ios';
|
|
4
5
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
5
6
|
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
7
|
+
import { getCallingxLib } from './libs';
|
|
6
8
|
export function setupIosVoipPushEvents(pushConfig) {
|
|
7
9
|
if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
|
|
8
10
|
return;
|
|
@@ -13,14 +15,13 @@ export function setupIosVoipPushEvents(pushConfig) {
|
|
|
13
15
|
logger.debug('ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents');
|
|
14
16
|
return;
|
|
15
17
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
onVoipNotificationReceived(notification, pushConfig);
|
|
18
|
+
const callingx = getCallingxLib();
|
|
19
|
+
const voipNotificationReceivedListener = callingx.addEventListener('voipNotificationReceived', params => {
|
|
20
|
+
onVoipNotificationReceived(params, pushConfig);
|
|
20
21
|
});
|
|
21
22
|
setPushLogoutCallback(async () => {
|
|
22
23
|
videoLoggerSystem.getLogger('setPushLogoutCallback').debug('notification event listener removed');
|
|
23
|
-
|
|
24
|
+
voipNotificationReceivedListener.remove();
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=setupIosVoipPushEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Platform","onVoipNotificationReceived","setPushLogoutCallback","videoLoggerSystem","getCallingxLib","setupIosVoipPushEvents","pushConfig","OS","ios","pushProviderName","logger","getLogger","debug","callingx","voipNotificationReceivedListener","addEventListener","params","remove"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,cAAc,QAAQ,QAAQ;AAEvC,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,IAAIN,QAAQ,CAACO,EAAE,KAAK,KAAK,IAAI,CAACD,UAAU,CAACE,GAAG,EAAEC,gBAAgB,EAAE;IAC9D;EACF;EACA,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAI,CAACL,UAAU,CAACE,GAAG,CAACC,gBAAgB,EAAE;IACpC;IACAC,MAAM,CAACE,KAAK,CACV,6EACF,CAAC;IACD;EACF;EAEA,MAAMC,QAAQ,GAAGT,cAAc,CAAC,CAAC;EACjC,MAAMU,gCAAgC,GAAGD,QAAQ,CAACE,gBAAgB,CAChE,0BAA0B,EACzBC,MAAM,IAAK;IACVf,0BAA0B,CAACe,MAAM,EAAEV,UAAU,CAAC;EAChD,CACF,CAAC;EAEDJ,qBAAqB,CAAC,YAAY;IAChCC,iBAAiB,CACdQ,SAAS,CAAC,uBAAuB,CAAC,CAClCC,KAAK,CAAC,qCAAqC,CAAC;IAC/CE,gCAAgC,CAACG,MAAM,CAAC,CAAC;EAC3C,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.29.
|
|
1
|
+
export const version = '1.29.4-beta.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAKjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCallingExpWithCallingStateEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useCallingExpWithCallingStateEffect.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,mCAAmC,YAuI/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIosVoipPushEventsSetupEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useIosVoipPushEventsSetupEffect.ts"],"names":[],"mappings":"AAoCA;;;GAGG;AACH,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"useIosVoipPushEventsSetupEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useIosVoipPushEventsSetupEffect.ts"],"names":[],"mappings":"AAoCA;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YAgI3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAndroidKeepCallAliveEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAndroidKeepCallAliveEffect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAndroidKeepCallAliveEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAndroidKeepCallAliveEffect.ts"],"names":[],"mappings":"AA+EA;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YA2HzC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import 'text-encoding-polyfill';
|
|
|
4
4
|
import 'react-native-url-polyfill/auto';
|
|
5
5
|
/** i18next polyfill to handle intl format for pluralization. For more info see https://www.i18next.com/misc/json-format#i-18-next-json-v4 */
|
|
6
6
|
import 'intl-pluralrules';
|
|
7
|
+
import './utils/keepCallAliveHeadlessTask';
|
|
7
8
|
export * from '@stream-io/video-client';
|
|
8
9
|
export * from '@stream-io/video-react-bindings';
|
|
9
10
|
export * from './components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,+CAA+C;AAC/C,OAAO,wBAAwB,CAAC;AAChC,8BAA8B;AAC9B,OAAO,gCAAgC,CAAC;AACxC,6IAA6I;AAC7I,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,+CAA+C;AAC/C,OAAO,wBAAwB,CAAC;AAChC,8BAA8B;AAC9B,OAAO,gCAAgC,CAAC;AACxC,6IAA6I;AAC7I,OAAO,kBAAkB,CAAC;AAK1B,OAAO,mCAAmC,CAAC;AAa3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AAIvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,cAAc,+BAA+B,CAAC"}
|
|
@@ -64,6 +64,11 @@ export declare class CallManager {
|
|
|
64
64
|
* in the native layer.
|
|
65
65
|
*/
|
|
66
66
|
logAudioState: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* For debugging purposes, returns the current audio state as a string.
|
|
69
|
+
* @returns A string containing the current audio state information.
|
|
70
|
+
*/
|
|
71
|
+
getAudioStateLog: () => string;
|
|
67
72
|
}
|
|
68
73
|
export {};
|
|
69
74
|
//# sourceMappingURL=CallManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallManager.d.ts","sourceRoot":"","sources":["../../../../src/modules/call-manager/CallManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CallManager.d.ts","sourceRoot":"","sources":["../../../../src/modules/call-manager/CallManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAWvE,cAAM,kBAAkB;IACtB,OAAO,CAAC,YAAY,CAAC,CAAqB;IAE1C;;OAEG;IACH,oBAAoB,QAAa,OAAO,CAAC,iBAAiB,CAAC,CAGzD;IAEF;;;;OAIG;IACH,iBAAiB,GAAI,cAAc,MAAM,KAAG,IAAI,CAG9C;IAEF;;;OAGG;IACH,4BAA4B,GAC1B,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,KACvD,CAAC,MAAM,IAAI,CAAC,CAKb;CACH;AAED,cAAM,cAAc;IAClB;;OAEG;IACH,kBAAkB,QAAO,IAAI,CAG3B;CACH;AAED,cAAM,cAAc;IAClB;;OAEG;IACH,OAAO,GAAI,MAAM,OAAO,KAAG,IAAI,CAM7B;IAEF;;OAEG;IACH,sBAAsB,GAAI,OAAO,OAAO,KAAG,IAAI,CAE7C;CACH;AAeD,qBAAa,WAAW;IACtB,OAAO,qBAA4B;IACnC,GAAG,iBAAwB;IAC3B,OAAO,iBAAwB;IAE/B;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,GAAI,SAAS,yBAAyB,KAAG,IAAI,CAkBhD;IAEF;;OAEG;IACH,IAAI,QAAO,IAAI,CAQb;IAEF;;;OAGG;IACH,aAAa,QAAO,IAAI,CAAkC;IAE1D;;;OAGG;IACH,gBAAgB,QAAO,MAAM,CAAqC;CACnE"}
|