@stream-io/video-react-native-sdk 1.29.1-beta.0 → 1.29.2
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 +3133 -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/hooks/push/index.js +2 -0
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/index.js +6 -6
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -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 +34 -17
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +20 -32
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
- package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +19 -8
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/hooks/push/index.js +2 -0
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +0 -26
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/providers/StreamCall/index.js +6 -6
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +21 -33
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
- 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 +34 -17
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +44 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +19 -29
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/callkeep.js +11 -0
- package/dist/module/utils/push/libs/callkeep.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +2 -1
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +18 -0
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
- package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +0 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +2 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +2 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/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/StreamInCallManager.m +0 -2
- package/ios/StreamInCallManager.swift +7 -19
- package/ios/StreamVideoReactNative.h +4 -7
- package/ios/StreamVideoReactNative.m +82 -189
- package/package.json +19 -14
- package/src/hooks/push/index.ts +2 -0
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
- package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
- package/src/index.ts +0 -1
- package/src/modules/call-manager/CallManager.ts +0 -36
- package/src/modules/call-manager/native-module.d.ts +0 -7
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +30 -40
- package/src/utils/StreamVideoRN/types.ts +29 -56
- package/src/utils/internal/registerSDKGlobals.ts +4 -47
- package/src/utils/push/android.ts +309 -231
- package/src/utils/push/internal/ios.ts +44 -28
- package/src/utils/push/internal/rxSubjects.ts +61 -0
- package/src/utils/push/internal/utils.ts +26 -45
- package/src/utils/push/ios.ts +6 -1
- package/src/utils/push/libs/callkeep.ts +16 -0
- package/src/utils/push/libs/index.ts +2 -1
- package/src/utils/push/libs/notifee/index.ts +27 -0
- package/src/utils/push/libs/voipPushNotification.ts +17 -0
- package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
- package/src/version.ts +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callingx.js +0 -75
- package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/module/utils/internal/callingx/callingx.js +0 -100
- package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/module/utils/push/libs/callingx.js +0 -67
- package/dist/module/utils/push/libs/callingx.js.map +0 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
- package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -13
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
- package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
- package/src/utils/internal/callingx/callingx.ts +0 -146
- package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
- package/src/utils/push/libs/callingx.ts +0 -90
- package/src/utils/push/setupCallingExpEvents.ts +0 -130
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pushLogoutCallbacks","newNotificationCallbacks","
|
|
1
|
+
{"version":3,"names":["pushLogoutCallbacks","newNotificationCallbacks","setupIosCallKeepEvents","setupIosVoipPushEvents","NativeModules","Platform","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","lights","vibration","importance","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","busyToneTimeout","updateConfig","updateAndroidIncomingCallChannel","updateChannel","prevChannel","push","incomingCallChannel","setPushConfig","pushConfig","__DEV__","navigateAcceptCall","navigateToIncomingCall","Error","getConfig","onPushLogout","current","all","map","callback","then","resolve","clearPushLogoutCallbacks","addOnNewCallNotificationListener","filter","cb","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":"AACA,OAAOA,mBAAmB,MAAM,gCAAgC;AAChE,OAAOC,wBAAwB,MAExB,sCAAsC;AAC7C,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;;AAEtD;;AAKA;AACA,SAASC,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B,IACE,OAAOH,MAAM,CAACE,GAAG,CAAC,KAAK,QAAQ,IAC/BF,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACL,MAAM,CAACE,GAAG,CAAC,CAAC,IAC3B,OAAOH,MAAM,CAACG,GAAG,CAAC,KAAK,QAAQ,IAC/BH,MAAM,CAACG,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACN,MAAM,CAACG,GAAG,CAAC,CAAC,EAC3B;QACAD,MAAM,CAACC,GAAG,CAAC,GAAGJ,SAAS,CACrBC,MAAM,CAACG,GAAG,CAAC,EACXF,MAAM,CAACE,GAAG,CACZ,CAAC;MACH,CAAC,MAAM;QACLD,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CA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YAAYA,CAAA,EAAG;IAC1B,OAAOrD,aAAa,CAACoD,sBAAsB,CAACC,YAAY,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;AACA;EACE,aAAaC,6BAA6BA,CAAA,EAAqB;IAC7D,IAAIrD,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,qEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACI,sBAAsB,CAAC,CAAC;EACtE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,4BAA4BA,CAAA,EAAqB;IAC5D,IAAIxD,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,oEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACM,qBAAqB,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,wBAAwBA,CAAA,EAAqB;IACxD,IAAI1D,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,gEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACQ,iBAAiB,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
|
|
@@ -1,67 +1,18 @@
|
|
|
1
1
|
import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
|
|
2
|
-
import { getCallingxLibIfAvailable } from '../push/libs/callingx';
|
|
3
|
-
import { endCallingxCall, startCallingxCall } from './callingx/callingx';
|
|
4
2
|
const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
|
|
5
3
|
const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative;
|
|
6
|
-
const CallingxModule = getCallingxLibIfAvailable();
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks if StreamInCallManager should be bypassed because CallKit is handling
|
|
10
|
-
* the audio session via CallingX.
|
|
11
|
-
*
|
|
12
|
-
* On iOS, when CallingX is set up and has a registered call, the audio session
|
|
13
|
-
* is managed by CallKit through CallingxImpl.swift.
|
|
14
|
-
* In this case, StreamInCallManager should not run to avoid conflicting audio
|
|
15
|
-
* session configurations.
|
|
16
|
-
*/
|
|
17
|
-
const shouldBypassForCallKit = ({
|
|
18
|
-
isRingingTypeCall
|
|
19
|
-
}) => {
|
|
20
|
-
if (Platform.OS !== 'ios') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (!CallingxModule) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
const bypass = CallingxModule.isSetup && (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
|
|
27
|
-
return bypass;
|
|
28
|
-
};
|
|
29
4
|
const streamRNVideoSDKGlobals = {
|
|
30
|
-
callingX: {
|
|
31
|
-
startCall: startCallingxCall,
|
|
32
|
-
endCall: endCallingxCall
|
|
33
|
-
},
|
|
34
5
|
callManager: {
|
|
35
6
|
setup: ({
|
|
36
|
-
defaultDevice
|
|
37
|
-
isRingingTypeCall
|
|
7
|
+
defaultDevice
|
|
38
8
|
}) => {
|
|
39
|
-
if (shouldBypassForCallKit({
|
|
40
|
-
isRingingTypeCall
|
|
41
|
-
})) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
9
|
StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
45
10
|
StreamInCallManagerNativeModule.setup();
|
|
46
11
|
},
|
|
47
|
-
start: ({
|
|
48
|
-
isRingingTypeCall
|
|
49
|
-
}) => {
|
|
50
|
-
if (shouldBypassForCallKit({
|
|
51
|
-
isRingingTypeCall
|
|
52
|
-
})) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
12
|
+
start: () => {
|
|
55
13
|
StreamInCallManagerNativeModule.start();
|
|
56
14
|
},
|
|
57
|
-
stop: ({
|
|
58
|
-
isRingingTypeCall
|
|
59
|
-
}) => {
|
|
60
|
-
if (shouldBypassForCallKit({
|
|
61
|
-
isRingingTypeCall
|
|
62
|
-
})) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
15
|
+
stop: () => {
|
|
65
16
|
StreamInCallManagerNativeModule.stop();
|
|
66
17
|
}
|
|
67
18
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","PermissionsAndroid","Platform","
|
|
1
|
+
{"version":3,"names":["NativeModules","PermissionsAndroid","Platform","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","streamRNVideoSDKGlobals","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","OS","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":"AACA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAE1E,MAAMC,+BAA+B,GAAGH,aAAa,CAACI,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGL,aAAa,CAACM,sBAElD;AAED,MAAMC,uBAAgD,GAAG;EACvDC,WAAW,EAAE;IACXC,KAAK,EAAEA,CAAC;MAAEC;IAAc,CAAC,KAAK;MAC5BP,+BAA+B,CAACQ,iCAAiC,CAC/DD,aACF,CAAC;MACDP,+BAA+B,CAACM,KAAK,CAAC,CAAC;IACzC,CAAC;IACDG,KAAK,EAAEA,CAAA,KAAM;MACXT,+BAA+B,CAACS,KAAK,CAAC,CAAC;IACzC,CAAC;IACDC,IAAI,EAAEA,CAAA,KAAM;MACVV,+BAA+B,CAACU,IAAI,CAAC,CAAC;IACxC;EACF,CAAC;EACDC,WAAW,EAAE;IACXC,KAAK,EAAE,MAAOC,UAAU,IAAK;MAC3B,IAAId,QAAQ,CAACe,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMC,uBAAuB,GAC3BF,UAAU,KAAK,QAAQ,GACnBf,kBAAkB,CAACkB,WAAW,CAACC,MAAM,GACrCnB,kBAAkB,CAACkB,WAAW,CAACE,YAAY;QACjD,OAAOpB,kBAAkB,CAACc,KAAK,CAACG,uBAAuB,CAAC;MAC1D;;MAEA;MACA,OAAOI,OAAO,CACZ,MAAMjB,4BAA4B,CAACkB,eAAe,GAAGP,UAAU,CACjE,CAAC;IACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASQ,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,MAAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGnB,uBAAuB;EACnD;AACF","ignoreList":[]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
2
2
|
import { AppState, Platform } from 'react-native';
|
|
3
|
-
import { getExpoNotificationsLib, getExpoNotificationsLibNoThrow, getFirebaseMessagingLib, getFirebaseMessagingLibNoThrow, getNotifeeLibThrowIfNotInstalledForPush } from './libs';
|
|
4
|
-
import { pushNonRingingCallData$ } from './internal/rxSubjects';
|
|
3
|
+
import { getExpoNotificationsLib, getExpoNotificationsLibNoThrow, getFirebaseMessagingLib, getFirebaseMessagingLibNoThrow, getIncomingCallForegroundServiceTypes, getNotifeeLibThrowIfNotInstalledForPush } from './libs';
|
|
4
|
+
import { pushAcceptedIncomingCallCId$, pushAndroidBackgroundDeliveredIncomingCallCId$, pushNonRingingCallData$, pushRejectedIncomingCallCId$, pushTappedIncomingCallCId$ } from './internal/rxSubjects';
|
|
5
5
|
import { pushUnsubscriptionCallbacks } from './internal/constants';
|
|
6
|
-
import {
|
|
6
|
+
import { canAddPushWSSubscriptionsRef, clearPushWSEventSubscriptions, processCallFromPushInBackground, shouldCallBeEnded } from './internal/utils';
|
|
7
7
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
8
|
+
import { getAndroidDefaultRingtoneUrl } from '../getAndroidDefaultRingtoneUrl';
|
|
8
9
|
import { StreamVideoRN } from '../StreamVideoRN';
|
|
9
|
-
|
|
10
|
+
const ACCEPT_CALL_ACTION_ID = 'accept';
|
|
11
|
+
const DECLINE_CALL_ACTION_ID = 'decline';
|
|
10
12
|
let lastFirebaseToken = {
|
|
11
13
|
token: '',
|
|
12
14
|
userId: ''
|
|
@@ -61,7 +63,8 @@ export async function initAndroidPushToken(client, pushConfig, setUnsubscribeLis
|
|
|
61
63
|
await setDeviceToken(token);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
// TODO: remove the incomingCallChannel check and find a better way once we have telecom integration for android
|
|
67
|
+
const messaging = pushConfig.isExpo && !pushConfig.android.incomingCallChannel ? getFirebaseMessagingLibNoThrow(true) : getFirebaseMessagingLib();
|
|
65
68
|
if (messaging) {
|
|
66
69
|
logger.debug(`setting firebase token listeners`);
|
|
67
70
|
const unsubscribe = messaging().onTokenRefresh(refreshedToken => setDeviceToken(refreshedToken));
|
|
@@ -75,8 +78,8 @@ export async function initAndroidPushToken(client, pushConfig, setUnsubscribeLis
|
|
|
75
78
|
* Creates notification from the push message data.
|
|
76
79
|
* For Ringing and Non-Ringing calls.
|
|
77
80
|
*/
|
|
78
|
-
|
|
79
81
|
export const firebaseDataHandler = async data => {
|
|
82
|
+
if (Platform.OS !== 'android') return;
|
|
80
83
|
/* Example data from firebase
|
|
81
84
|
"message": {
|
|
82
85
|
"data": {
|
|
@@ -92,175 +95,174 @@ export const firebaseDataHandler = async data => {
|
|
|
92
95
|
// other stuff
|
|
93
96
|
}
|
|
94
97
|
*/
|
|
95
|
-
if (Platform.OS !== 'android') return;
|
|
96
|
-
const logger = videoLoggerSystem.getLogger('firebaseDataHandler');
|
|
97
98
|
const pushConfig = StreamVideoRN.getConfig().push;
|
|
98
99
|
if (!pushConfig || !data || data.sender !== 'stream.video') {
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
102
|
+
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
103
|
+
const notifee = notifeeLib.default;
|
|
104
|
+
const settings = await notifee.getNotificationSettings();
|
|
105
|
+
if (settings.authorizationStatus !== 1) {
|
|
106
|
+
const logger = videoLoggerSystem.getLogger('firebaseDataHandler');
|
|
107
|
+
logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
101
110
|
if (data.type === 'call.ring') {
|
|
102
111
|
const call_cid = data.call_cid;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
logger.debug(`video client not found, skipping the call.ring notification`);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const shouldRejectCallWhenBusy = client['rejectCallWhenBusy'] ?? false;
|
|
118
|
-
if (callingx.hasRegisteredCall() && shouldRejectCallWhenBusy) {
|
|
119
|
-
logger.debug(`registered call found, skipping the call.ring notification`);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
112
|
+
const created_by_id = data.created_by_id;
|
|
113
|
+
const receiver_id = data.receiver_id;
|
|
114
|
+
const video_client = await pushConfig.createStreamVideoClient();
|
|
115
|
+
await video_client?.onRingingCall(call_cid);
|
|
116
|
+
const shouldCallBeClosed = callToCheck => {
|
|
117
|
+
const {
|
|
118
|
+
mustEndCall
|
|
119
|
+
} = shouldCallBeEnded(callToCheck, created_by_id, receiver_id);
|
|
120
|
+
return mustEndCall;
|
|
121
|
+
};
|
|
122
|
+
const canListenToWS = () => canAddPushWSSubscriptionsRef.current && AppState.currentState !== 'active';
|
|
122
123
|
const asForegroundService = canListenToWS();
|
|
123
|
-
const callerName = data.created_by_display_name;
|
|
124
|
-
const hasVideo = data.video === 'true';
|
|
125
124
|
if (asForegroundService) {
|
|
126
125
|
// Listen to call events from WS through fg service
|
|
127
126
|
// note: this will replace the current empty fg service runner
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
logger.debug(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
|
|
151
|
-
finishBackgroundTask();
|
|
152
|
-
callingx.log(`Ending call with callCid: ${call_cid} endCallReason: ${endCallReason}`, 'debug');
|
|
153
|
-
callingx.endCallWithReason(call_cid, endCallReason);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const unsubscribeFunctions = [];
|
|
157
|
-
// check if service needs to be closed if accept/decline event was done on another device
|
|
158
|
-
const unsubscribe = callFromPush.on('all', event => {
|
|
159
|
-
const _canListenToWS = canListenToWS();
|
|
160
|
-
if (!_canListenToWS) {
|
|
161
|
-
logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
|
|
162
|
-
event
|
|
163
|
-
});
|
|
164
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
165
|
-
finishBackgroundTask();
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const {
|
|
169
|
-
mustEndCall: mustEndCallFromEvent,
|
|
170
|
-
endCallReason: endCallReasonFromEvent
|
|
171
|
-
} = shouldCallBeClosed(callFromPush, data);
|
|
172
|
-
if (mustEndCallFromEvent) {
|
|
173
|
-
logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed`, {
|
|
174
|
-
event
|
|
175
|
-
});
|
|
176
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
177
|
-
finishBackgroundTask();
|
|
178
|
-
callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
|
|
179
|
-
}
|
|
127
|
+
notifee.registerForegroundService(() => {
|
|
128
|
+
return new Promise(async () => {
|
|
129
|
+
const client = await pushConfig.createStreamVideoClient();
|
|
130
|
+
if (!client) {
|
|
131
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service as there is no client to create from push config`);
|
|
132
|
+
notifee.stopForegroundService();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const callFromPush = await client.onRingingCall(call_cid);
|
|
136
|
+
let _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
|
|
137
|
+
if (_shouldCallBeClosed) {
|
|
138
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service callCid: ${call_cid} shouldCallBeClosed: ${_shouldCallBeClosed}`);
|
|
139
|
+
notifee.stopForegroundService();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const unsubscribeFunctions = [];
|
|
143
|
+
// check if service needs to be closed if accept/decline event was done on another device
|
|
144
|
+
const unsubscribe = callFromPush.on('all', event => {
|
|
145
|
+
const _canListenToWS = canListenToWS();
|
|
146
|
+
if (!_canListenToWS) {
|
|
147
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
|
|
148
|
+
event
|
|
180
149
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
callingx.log(`Ending call with callCid: ${call_cid} callingState: ${callingState}`, 'debug');
|
|
190
|
-
finishBackgroundTask();
|
|
191
|
-
callingx.endCallWithReason(call_cid, 'remote');
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
const endCallSubscription = callingx.addEventListener('endCall', async ({
|
|
195
|
-
callId
|
|
196
|
-
}) => {
|
|
197
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
198
|
-
try {
|
|
199
|
-
await callFromPush.leave({
|
|
200
|
-
reject: true,
|
|
201
|
-
reason: 'decline'
|
|
202
|
-
});
|
|
203
|
-
} catch (error) {
|
|
204
|
-
logger.error(`Failed to leave call with callCid: ${call_cid} error: ${error}`);
|
|
205
|
-
} finally {
|
|
206
|
-
callingx.log(`Ending call with callCid: ${call_cid} callId: ${callId}`, 'debug');
|
|
207
|
-
finishBackgroundTask();
|
|
208
|
-
callingx.endCallWithReason(callId, 'rejected');
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
//stop background task when app comes to foreground
|
|
213
|
-
const appStateSubscription = AppState.addEventListener('change', nextAppState => {
|
|
214
|
-
const _canListenToWS = canListenToWS();
|
|
215
|
-
callingx.log(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, 'debug');
|
|
216
|
-
if (!_canListenToWS) {
|
|
217
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
218
|
-
finishBackgroundTask();
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
150
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
151
|
+
notifee.stopForegroundService();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
_shouldCallBeClosed = shouldCallBeClosed(callFromPush);
|
|
155
|
+
if (_shouldCallBeClosed) {
|
|
156
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_shouldCallBeClosed}`, {
|
|
157
|
+
event
|
|
221
158
|
});
|
|
222
|
-
unsubscribeFunctions.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
159
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
160
|
+
notifee.stopForegroundService();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
// check if service needs to be closed if call was left
|
|
164
|
+
const subscription = callFromPush.state.callingState$.subscribe(callingState => {
|
|
165
|
+
if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
|
|
166
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
|
|
167
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
168
|
+
notifee.stopForegroundService();
|
|
231
169
|
}
|
|
232
|
-
})
|
|
170
|
+
});
|
|
171
|
+
unsubscribeFunctions.push(unsubscribe);
|
|
172
|
+
unsubscribeFunctions.push(() => subscription.unsubscribe());
|
|
173
|
+
pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
|
|
174
|
+
pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
|
|
233
175
|
});
|
|
234
176
|
});
|
|
235
177
|
}
|
|
236
|
-
|
|
237
|
-
|
|
178
|
+
const incomingCallChannel = pushConfig.android.incomingCallChannel;
|
|
179
|
+
const incomingCallNotificationTextGetters = pushConfig.android.incomingCallNotificationTextGetters;
|
|
180
|
+
if (!incomingCallChannel || !incomingCallNotificationTextGetters) {
|
|
181
|
+
const logger = videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
|
|
182
|
+
logger.error("Can't show incoming call notification as either or both incomingCallChannel and incomingCallNotificationTextGetters were not provided");
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
/*
|
|
186
|
+
* Sound has to be set on channel level for android 8 and above and cant be updated later after creation!
|
|
187
|
+
* For android 7 and below, sound should be set on notification level
|
|
188
|
+
*/
|
|
189
|
+
// set default ringtone if not provided
|
|
190
|
+
if (!incomingCallChannel.sound) {
|
|
191
|
+
incomingCallChannel.sound = await getAndroidDefaultRingtoneUrl();
|
|
192
|
+
}
|
|
193
|
+
await notifee.createChannel(incomingCallChannel);
|
|
194
|
+
const {
|
|
195
|
+
getTitle,
|
|
196
|
+
getBody,
|
|
197
|
+
getAcceptButtonTitle,
|
|
198
|
+
getDeclineButtonTitle
|
|
199
|
+
} = incomingCallNotificationTextGetters;
|
|
200
|
+
const createdUserName = data.created_by_display_name;
|
|
201
|
+
const title = getTitle(createdUserName);
|
|
202
|
+
const body = getBody(createdUserName);
|
|
203
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying incoming call notification with callCid: ${call_cid} title: ${title} body: ${body} asForegroundService: ${asForegroundService}`);
|
|
204
|
+
const channelId = incomingCallChannel.id;
|
|
205
|
+
await notifee.displayNotification({
|
|
206
|
+
id: call_cid,
|
|
207
|
+
title: getTitle(createdUserName),
|
|
208
|
+
body: getBody(createdUserName),
|
|
209
|
+
data,
|
|
210
|
+
android: {
|
|
211
|
+
channelId,
|
|
212
|
+
smallIcon: pushConfig.android.smallIcon,
|
|
213
|
+
importance: 4,
|
|
214
|
+
// high importance
|
|
215
|
+
foregroundServiceTypes: getIncomingCallForegroundServiceTypes(),
|
|
216
|
+
asForegroundService,
|
|
217
|
+
ongoing: true,
|
|
218
|
+
sound: incomingCallChannel.sound,
|
|
219
|
+
vibrationPattern: incomingCallChannel.vibrationPattern,
|
|
220
|
+
loopSound: true,
|
|
221
|
+
pressAction: {
|
|
222
|
+
id: 'default',
|
|
223
|
+
launchActivity: 'default' // open the app when the notification is pressed
|
|
224
|
+
},
|
|
225
|
+
actions: [{
|
|
226
|
+
title: getDeclineButtonTitle?.() ?? 'Decline',
|
|
227
|
+
pressAction: {
|
|
228
|
+
id: DECLINE_CALL_ACTION_ID
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
title: getAcceptButtonTitle?.() ?? 'Accept',
|
|
232
|
+
pressAction: {
|
|
233
|
+
id: ACCEPT_CALL_ACTION_ID,
|
|
234
|
+
launchActivity: 'default' // open the app when the notification is pressed
|
|
235
|
+
}
|
|
236
|
+
}],
|
|
237
|
+
category: notifeeLib.AndroidCategory.CALL,
|
|
238
|
+
fullScreenAction: {
|
|
239
|
+
id: 'stream_ringing_incoming_call'
|
|
240
|
+
},
|
|
241
|
+
timeoutAfter: 60000 // 60 seconds, after which the notification will be dismissed automatically
|
|
242
|
+
}
|
|
243
|
+
});
|
|
238
244
|
if (asForegroundService) {
|
|
239
245
|
// no need to check if call has be closed as that will be handled by the fg service
|
|
240
246
|
return;
|
|
241
247
|
}
|
|
248
|
+
|
|
249
|
+
// check if call needs to be closed if accept/decline event was done
|
|
250
|
+
// before the notification was shown
|
|
251
|
+
const client = await pushConfig.createStreamVideoClient();
|
|
252
|
+
if (!client) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
242
255
|
const callFromPush = await client.onRingingCall(call_cid);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
} = shouldCallBeClosed(callFromPush, data);
|
|
247
|
-
if (mustEndCall) {
|
|
248
|
-
logger.debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
|
|
249
|
-
callingx.endCallWithReason(call_cid, endCallReason);
|
|
256
|
+
if (shouldCallBeClosed(callFromPush)) {
|
|
257
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
|
|
258
|
+
notifee.cancelDisplayedNotification(call_cid);
|
|
250
259
|
}
|
|
251
260
|
} else {
|
|
252
|
-
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
253
|
-
const notifee = notifeeLib.default;
|
|
254
|
-
const settings = await notifee.getNotificationSettings();
|
|
255
|
-
if (settings.authorizationStatus !== 1) {
|
|
256
|
-
logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
261
|
// the other types are call.live_started and call.notification
|
|
261
262
|
const callChannel = pushConfig.android.callChannel;
|
|
262
263
|
const callNotificationTextGetters = pushConfig.android.callNotificationTextGetters;
|
|
263
264
|
if (!callChannel || !callNotificationTextGetters) {
|
|
265
|
+
const logger = videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
|
|
264
266
|
logger.debug("Can't show call notification as either or both callChannel and callNotificationTextGetters is not provided");
|
|
265
267
|
return;
|
|
266
268
|
}
|
|
@@ -275,10 +277,10 @@ export const firebaseDataHandler = async data => {
|
|
|
275
277
|
const type = data.type;
|
|
276
278
|
const title = getTitle(type, createdUserName);
|
|
277
279
|
const body = getBody(type, createdUserName);
|
|
278
|
-
|
|
280
|
+
videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`);
|
|
279
281
|
await notifee.displayNotification({
|
|
280
|
-
title,
|
|
281
|
-
body,
|
|
282
|
+
title: getTitle(type, createdUserName),
|
|
283
|
+
body: getBody(type, createdUserName),
|
|
282
284
|
data,
|
|
283
285
|
android: {
|
|
284
286
|
sound: callChannel.sound,
|
|
@@ -302,7 +304,8 @@ export const firebaseDataHandler = async data => {
|
|
|
302
304
|
}
|
|
303
305
|
};
|
|
304
306
|
export const onAndroidNotifeeEvent = async ({
|
|
305
|
-
event
|
|
307
|
+
event,
|
|
308
|
+
isBackground
|
|
306
309
|
}) => {
|
|
307
310
|
if (Platform.OS !== 'android') return;
|
|
308
311
|
const {
|
|
@@ -310,7 +313,8 @@ export const onAndroidNotifeeEvent = async ({
|
|
|
310
313
|
detail
|
|
311
314
|
} = event;
|
|
312
315
|
const {
|
|
313
|
-
notification
|
|
316
|
+
notification,
|
|
317
|
+
pressAction
|
|
314
318
|
} = detail;
|
|
315
319
|
const notificationId = notification?.id;
|
|
316
320
|
const data = notification?.data;
|
|
@@ -321,10 +325,53 @@ export const onAndroidNotifeeEvent = async ({
|
|
|
321
325
|
|
|
322
326
|
// we can safely cast to string because the data is from "stream.video"
|
|
323
327
|
const call_cid = data.call_cid;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
+
if (data.type === 'call.ring') {
|
|
329
|
+
// check if we have observers for the call cid (this means the app is in the foreground state)
|
|
330
|
+
const hasObservers = pushAcceptedIncomingCallCId$.observed && pushRejectedIncomingCallCId$.observed;
|
|
331
|
+
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
332
|
+
const notifee = notifeeLib.default;
|
|
333
|
+
// Check if we need to decline the call
|
|
334
|
+
const didPressDecline = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === DECLINE_CALL_ACTION_ID;
|
|
335
|
+
const didDismiss = type === notifeeLib.EventType.DISMISSED;
|
|
336
|
+
const mustDecline = didPressDecline || didDismiss;
|
|
337
|
+
// Check if we need to accept the call
|
|
338
|
+
const mustAccept = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === ACCEPT_CALL_ACTION_ID;
|
|
339
|
+
if (mustAccept || mustDecline || type === notifeeLib.EventType.ACTION_PRESS) {
|
|
340
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`clearPushWSEventSubscriptions for callCId: ${call_cid} mustAccept: ${mustAccept} mustDecline: ${mustDecline}`);
|
|
341
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
342
|
+
notifee.stopForegroundService();
|
|
343
|
+
}
|
|
344
|
+
if (mustAccept) {
|
|
345
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAcceptedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
346
|
+
pushAcceptedIncomingCallCId$.next(call_cid);
|
|
347
|
+
// NOTE: accept will be handled by the app with rxjs observers as the app will go to foreground always
|
|
348
|
+
} else if (mustDecline) {
|
|
349
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushRejectedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
350
|
+
pushRejectedIncomingCallCId$.next(call_cid);
|
|
351
|
+
if (hasObservers) {
|
|
352
|
+
// if we had observers we can return here as the observers will handle the call as the app is in the foreground state
|
|
353
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`Skipped processCallFromPushInBackground for Declining call with callCId: ${call_cid} as the app is in the foreground state`);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`start processCallFromPushInBackground - Declining call with callCId: ${call_cid}`);
|
|
357
|
+
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
358
|
+
} else {
|
|
359
|
+
if (type === notifeeLib.EventType.PRESS) {
|
|
360
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushTappedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
361
|
+
pushTappedIncomingCallCId$.next(call_cid);
|
|
362
|
+
// pressed state will be handled by the app with rxjs observers as the app will go to foreground always
|
|
363
|
+
} else if (isBackground && type === notifeeLib.EventType.DELIVERED) {
|
|
364
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAndroidBackgroundDeliveredIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
365
|
+
pushAndroidBackgroundDeliveredIncomingCallCId$.next(call_cid);
|
|
366
|
+
// background delivered state will be handled by the app with rxjs observers as processing needs to happen only when app is opened
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
371
|
+
if (type === notifeeLib.EventType.PRESS) {
|
|
372
|
+
videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
|
|
373
|
+
pushConfig.onTapNonRingingCallNotification?.(call_cid, data.type);
|
|
374
|
+
}
|
|
328
375
|
}
|
|
329
376
|
};
|
|
330
377
|
//# sourceMappingURL=android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CallingState","videoLoggerSystem","AppState","Platform","getExpoNotificationsLib","getExpoNotificationsLibNoThrow","getFirebaseMessagingLib","getFirebaseMessagingLibNoThrow","getNotifeeLibThrowIfNotInstalledForPush","pushNonRingingCallData$","pushUnsubscriptionCallbacks","canListenToWS","shouldCallBeClosed","setPushLogoutCallback","StreamVideoRN","getCallingxLib","lastFirebaseToken","token","userId","initAndroidPushToken","client","pushConfig","setUnsubscribeListener","OS","android","pushProviderName","logger","getLogger","setDeviceToken","streamClient","_user","id","anonymous","debug","removeDevice","err","warn","push_provider_name","addDevice","isExpo","expoNotificationsLib","onTapNonRingingCallNotification","subscription","addPushTokenListener","devicePushToken","data","remove","getDevicePushTokenAsync","messaging","unsubscribe","onTokenRefresh","refreshedToken","getToken","firebaseDataHandler","getConfig","push","sender","type","call_cid","callingx","canPostNotifications","createStreamVideoClient","shouldRejectCallWhenBusy","hasRegisteredCall","asForegroundService","callerName","created_by_display_name","hasVideo","video","registerBackgroundTask","_","stopTask","Promise","resolve","finishBackgroundTask","log","undefined","_client","callFromPush","onRingingCall","mustEndCall","endCallReason","endCallWithReason","unsubscribeFunctions","on","event","_canListenToWS","forEach","fn","mustEndCallFromEvent","endCallReasonFromEvent","stateSubscription","state","callingState$","subscribe","callingState","IDLE","LEFT","endCallSubscription","addEventListener","callId","leave","reject","reason","error","appStateSubscription","nextAppState","get","cb","set","displayIncomingCall","notifeeLib","notifee","default","settings","getNotificationSettings","authorizationStatus","callChannel","callNotificationTextGetters","createChannel","channelId","getTitle","getBody","createdUserName","title","body","displayNotification","sound","smallIcon","vibrationPattern","importance","pressAction","launchActivity","timeoutAfter","cid","next","onAndroidNotifeeEvent","detail","notification","notificationId","EventType","PRESS"],"sourceRoot":"../../../../src","sources":["utils/push/android.ts"],"mappings":"AAAA,SACEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAKjD,SAEEC,uBAAuB,EACvBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,8BAA8B,EAC9BC,uCAAuC,QAElC,QAAQ;AACf,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAASC,2BAA2B,QAAQ,sBAAsB;AAClE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kBAAkB;AACpE,SAASC,qBAAqB,QAAQ,gCAA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fC,WAAW,EAAE;UACXpG,EAAE,EAAE,SAAS;UACbqG,cAAc,EAAE,SAAS,CAAE;QAC7B,CAAC;QACDC,YAAY,EAAE,KAAK,CAAE;MACvB;IACF,CAAC,CAAC;IACF,MAAMC,GAAG,GAAGzF,IAAI,CAACa,QAAkB;IACnCjD,uBAAuB,CAAC8H,IAAI,CAAC;MAAED,GAAG;MAAE7E;IAAK,CAAC,CAAC;EAC7C;AACF,CAAC;AAED,OAAO,MAAM+E,qBAAqB,GAAG,MAAAA,CAAO;EAAEnD;AAAwB,CAAC,KAAK;EAC1E,IAAIlF,QAAQ,CAACoB,EAAE,KAAK,SAAS,EAAE;EAC/B,MAAM;IAAEkC,IAAI;IAAEgF;EAAO,CAAC,GAAGpD,KAAK;EAC9B,MAAM;IAAEqD;EAAa,CAAC,GAAGD,MAAM;EAC/B,MAAME,cAAc,GAAGD,YAAY,EAAE3G,EAAE;EACvC,MAAMc,IAAI,GAAG6F,YAAY,EAAE7F,IAAI;EAC/B,MAAMxB,UAAU,GAAGP,aAAa,CAACwC,SAAS,CAAC,CAAC,CAACC,IAAI;EACjD,IACE,CAAClC,UAAU,IACX,CAACwB,IAAI,IACL,CAAC8F,cAAc,IACf9F,IAAI,CAACW,MAAM,KAAK,cAAc,EAC9B;IACA;EACF;;EAEA;EACA,MAAME,QAAQ,GAAGb,IAAI,CAACa,QAAkB;EAExC,MAAMqD,UAAU,GAAGvG,uCAAuC,CAAC,CAAC;EAC5D,IAAIiD,IAAI,KAAKsD,UAAU,CAAC6B,SAAS,CAACC,KAAK,EAAE;IACvC5I,iBAAiB,CACd0B,SAAS,CAAC,uBAAuB,CAAC,CAClCM,KAAK,CAAC,iDAAiDyB,QAAQ,EAAE,CAAC;IACrErC,UAAU,CAACoB,+BAA+B,GACxCiB,QAAQ,EACRb,IAAI,CAACY,IACP,CAAC;EACH;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CallingState","videoLoggerSystem","AppState","Platform","getExpoNotificationsLib","getExpoNotificationsLibNoThrow","getFirebaseMessagingLib","getFirebaseMessagingLibNoThrow","getIncomingCallForegroundServiceTypes","getNotifeeLibThrowIfNotInstalledForPush","pushAcceptedIncomingCallCId$","pushAndroidBackgroundDeliveredIncomingCallCId$","pushNonRingingCallData$","pushRejectedIncomingCallCId$","pushTappedIncomingCallCId$","pushUnsubscriptionCallbacks","canAddPushWSSubscriptionsRef","clearPushWSEventSubscriptions","processCallFromPushInBackground","shouldCallBeEnded","setPushLogoutCallback","getAndroidDefaultRingtoneUrl","StreamVideoRN","ACCEPT_CALL_ACTION_ID","DECLINE_CALL_ACTION_ID","lastFirebaseToken","token","userId","initAndroidPushToken","client","pushConfig","setUnsubscribeListener","OS","android","pushProviderName","logger","getLogger","setDeviceToken","streamClient","_user","id","anonymous","debug","removeDevice","err","warn","push_provider_name","addDevice","isExpo","expoNotificationsLib","onTapNonRingingCallNotification","subscription","addPushTokenListener","devicePushToken","data","remove","getDevicePushTokenAsync","messaging","incomingCallChannel","unsubscribe","onTokenRefresh","refreshedToken","getToken","firebaseDataHandler","getConfig","push","sender","notifeeLib","notifee","default","settings","getNotificationSettings","authorizationStatus","type","call_cid","created_by_id","receiver_id","video_client","createStreamVideoClient","onRingingCall","shouldCallBeClosed","callToCheck","mustEndCall","canListenToWS","current","currentState","asForegroundService","registerForegroundService","Promise","stopForegroundService","callFromPush","_shouldCallBeClosed","unsubscribeFunctions","on","event","_canListenToWS","forEach","fn","state","callingState$","subscribe","callingState","IDLE","LEFT","get","cb","set","incomingCallNotificationTextGetters","error","sound","createChannel","getTitle","getBody","getAcceptButtonTitle","getDeclineButtonTitle","createdUserName","created_by_display_name","title","body","channelId","displayNotification","smallIcon","importance","foregroundServiceTypes","ongoing","vibrationPattern","loopSound","pressAction","launchActivity","actions","category","AndroidCategory","CALL","fullScreenAction","timeoutAfter","cancelDisplayedNotification","callChannel","callNotificationTextGetters","cid","next","onAndroidNotifeeEvent","isBackground","detail","notification","notificationId","hasObservers","observed","didPressDecline","EventType","ACTION_PRESS","didDismiss","DISMISSED","mustDecline","mustAccept","PRESS","DELIVERED"],"sourceRoot":"../../../../src","sources":["utils/push/android.ts"],"mappings":"AAAA,SAEEA,YAAY,EAEZC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAKjD,SAEEC,uBAAuB,EACvBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,8BAA8B,EAC9BC,qCAAqC,EACrCC,uCAAuC,QAElC,QAAQ;AACf,SACEC,4BAA4B,EAC5BC,8CAA8C,EAC9CC,uBAAuB,EACvBC,4BAA4B,EAC5BC,0BAA0B,QACrB,uBAAuB;AAC9B,SAASC,2BAA2B,QAAQ,sBAAsB;AAClE,SACEC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,+BAA+B,EAC/BC,iBAAiB,QACZ,kBAAkB;AACzB,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,4BAA4B,QAAQ,iCAAiC;AAC9E,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,MAAMC,qBAAqB,GAAG,QAAQ;AACtC,MAAMC,sBAAsB,GAAG,SAAS;AAUxC,IAAIC,iBAAiB,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC;;AAEjD;AACA,OAAO,eAAeC,oBAAoBA,CACxCC,MAAyB,EACzBC,UAAsB,EACtBC,sBAAyD,EACzD;EACA,IAAI5B,QAAQ,CAAC6B,EAAE,KAAK,SAAS,IAAI,CAACF,UAAU,CAACG,OAAO,CAACC,gBAAgB,EAAE;IACrE;EACF;EACA,MAAMC,MAAM,GAAGlC,iBAAiB,CAACmC,SAAS,CAAC,sBAAsB,CAAC;EAClE,MAAMC,cAAc,GAAG,MAAOX,KAAa,IAAK;IAC9C,MAAMC,MAAM,GAAGE,MAAM,CAACS,YAAY,CAACC,KAAK,EAAEC,EAAE,IAAI,EAAE;IAClD,IAAIX,MAAM,CAACS,YAAY,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