@stream-io/video-react-native-sdk 1.2.16 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1609 -0
- package/dist/commonjs/components/Call/CallControls/IncomingCallControls.js +2 -1
- package/dist/commonjs/components/Call/CallControls/IncomingCallControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/OutgoingCallControls.js +4 -3
- package/dist/commonjs/components/Call/CallControls/OutgoingCallControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js +7 -4
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallKeepEventsSetupEffect.js +43 -6
- package/dist/commonjs/hooks/push/useIosCallKeepEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +1 -1
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +2 -2
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +2 -7
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +3 -3
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +1 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/providers/StreamCall.js +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +5 -6
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/index.js +12 -0
- package/dist/commonjs/utils/index.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +23 -79
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/index.js +39 -0
- package/dist/commonjs/utils/push/index.js.map +1 -0
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -0
- package/dist/commonjs/utils/push/internal/utils.js +158 -0
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -0
- package/dist/commonjs/utils/push/ios.js +43 -84
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/commonjs/utils/push/libs/index.js +0 -11
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +1 -1
- package/dist/commonjs/utils/push/utils.js +29 -150
- package/dist/commonjs/utils/push/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallControls/IncomingCallControls.js +2 -1
- package/dist/module/components/Call/CallControls/IncomingCallControls.js.map +1 -1
- package/dist/module/components/Call/CallControls/OutgoingCallControls.js +4 -3
- package/dist/module/components/Call/CallControls/OutgoingCallControls.js.map +1 -1
- package/dist/module/components/Call/CallControls/RejectCallButton.js +7 -4
- package/dist/module/components/Call/CallControls/RejectCallButton.js.map +1 -1
- package/dist/module/hooks/push/useIosCallKeepEventsSetupEffect.js +41 -4
- package/dist/module/hooks/push/useIosCallKeepEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +2 -2
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +2 -7
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +3 -3
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +1 -0
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/providers/StreamCall.js +1 -1
- package/dist/module/providers/StreamCall.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +5 -6
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/index.js +1 -0
- package/dist/module/utils/index.js.map +1 -1
- package/dist/module/utils/push/android.js +20 -79
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/index.js +4 -0
- package/dist/module/utils/push/index.js.map +1 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -0
- package/dist/module/utils/push/internal/utils.js +147 -0
- package/dist/module/utils/push/internal/utils.js.map +1 -0
- package/dist/module/utils/push/ios.js +40 -81
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/module/utils/push/libs/index.js +0 -1
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/iosPushNotification.js.map +1 -1
- package/dist/module/utils/push/utils.js +25 -144
- package/dist/module/utils/push/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallControls/IncomingCallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/OutgoingCallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/RejectCallButton.d.ts +17 -2
- package/dist/typescript/components/Call/CallControls/RejectCallButton.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallKeepEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +6 -4
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/index.d.ts +1 -0
- package/dist/typescript/utils/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +12 -2
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/index.d.ts +4 -0
- package/dist/typescript/utils/push/index.d.ts.map +1 -0
- package/dist/typescript/utils/push/{rxSubjects.d.ts → internal/rxSubjects.d.ts} +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -0
- package/dist/typescript/utils/push/internal/utils.d.ts +43 -0
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -0
- package/dist/typescript/utils/push/ios.d.ts +8 -3
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts +2 -0
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/index.d.ts +0 -1
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +2 -0
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +1 -1
- package/dist/typescript/utils/push/utils.d.ts +14 -42
- package/dist/typescript/utils/push/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/package.json +6 -11
- package/src/components/Call/CallControls/IncomingCallControls.tsx +4 -1
- package/src/components/Call/CallControls/OutgoingCallControls.tsx +3 -2
- package/src/components/Call/CallControls/RejectCallButton.tsx +19 -3
- package/src/hooks/push/useIosCallKeepEventsSetupEffect.ts +62 -6
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +1 -1
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +2 -2
- package/src/hooks/push/useProcessPushCallEffect.ts +2 -7
- package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +3 -3
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +1 -0
- package/src/providers/StreamCall.tsx +1 -1
- package/src/utils/StreamVideoRN/index.ts +11 -6
- package/src/utils/StreamVideoRN/types.ts +6 -4
- package/src/utils/index.ts +1 -0
- package/src/utils/push/android.ts +28 -99
- package/src/utils/push/index.ts +3 -0
- package/src/utils/push/{rxSubjects.ts → internal/rxSubjects.ts} +1 -1
- package/src/utils/push/internal/utils.ts +178 -0
- package/src/utils/push/ios.ts +49 -115
- package/src/utils/push/libs/expoNotifications.ts +4 -0
- package/src/utils/push/libs/index.ts +0 -1
- package/src/utils/push/libs/iosPushNotification.ts +4 -0
- package/src/utils/push/utils.ts +44 -175
- package/src/version.ts +1 -1
- package/dist/commonjs/utils/push/libs/expoTaskManager.js +0 -17
- package/dist/commonjs/utils/push/libs/expoTaskManager.js.map +0 -1
- package/dist/commonjs/utils/push/rxSubjects.js.map +0 -1
- package/dist/module/utils/push/libs/expoTaskManager.js +0 -11
- package/dist/module/utils/push/libs/expoTaskManager.js.map +0 -1
- package/dist/module/utils/push/rxSubjects.js.map +0 -1
- package/dist/typescript/utils/push/libs/expoTaskManager.d.ts +0 -3
- package/dist/typescript/utils/push/libs/expoTaskManager.d.ts.map +0 -1
- package/dist/typescript/utils/push/rxSubjects.d.ts.map +0 -1
- package/ios/StreamVideoReactNative.xcodeproj/project.xcworkspace/xcuserdata/santhoshvaiyapuri.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StreamVideoReactNative.xcodeproj/xcuserdata/santhoshvaiyapuri.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/src/utils/push/libs/expoTaskManager.ts +0 -16
- /package/dist/commonjs/utils/push/{rxSubjects.js → internal/rxSubjects.js} +0 -0
- /package/dist/module/utils/push/{rxSubjects.js → internal/rxSubjects.js} +0 -0
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare const processCallFromPushInBackground: (pushConfig: PushConfig, call_cid: string, action: Parameters<typeof processCallFromPush>[2]) => Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* This function is used process the call from push notifications due to incoming call
|
|
18
|
-
* It does the following steps:
|
|
19
|
-
* 1. Get the call from the client if present or create a new call
|
|
20
|
-
* 2. Fetch the latest state of the call from the server if its not already in ringing state
|
|
21
|
-
* 3. Join or leave the call based on the user's action.
|
|
22
|
-
*/
|
|
23
|
-
export declare const processCallFromPush: (client: StreamVideoClient, call_cid: string, action: "accept" | "decline" | "pressed" | "backgroundDelivered", pushConfig: PushConfig) => Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* This function is used process the call from push notifications due to non ringing calls
|
|
26
|
-
* It does the following steps:
|
|
27
|
-
* 1. Get the call from the client if present or create a new call
|
|
28
|
-
* 2. Fetch the latest state of the call from the server if its not already in ringing state
|
|
29
|
-
* 3. Call all the callbacks to inform the app about the call
|
|
30
|
-
*/
|
|
31
|
-
export declare const processNonIncomingCallFromPush: (client: StreamVideoClient, call_cid: string, nonRingingNotificationType: NonRingingPushEvent) => Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* This function is used to clear all the push related WS subscriptions
|
|
34
|
-
* note: events are subscribed in push for accept/decline through WS
|
|
35
|
-
*/
|
|
36
|
-
export declare const clearPushWSEventSubscriptions: () => void;
|
|
37
|
-
/**
|
|
38
|
-
* This ref is used to check if the push WS subscriptions can be added
|
|
39
|
-
* It is used to avoid adding the push WS subscriptions when the client is connected to WS in the foreground
|
|
40
|
-
*/
|
|
41
|
-
export declare const canAddPushWSSubscriptionsRef: CanAddPushWSSubscriptionsRef;
|
|
42
|
-
export {};
|
|
1
|
+
import { Event } from '@notifee/react-native';
|
|
2
|
+
import { FirebaseMessagingTypes } from './libs/firebaseMessaging';
|
|
3
|
+
import { ExpoNotification } from './libs/expoNotifications';
|
|
4
|
+
import { NonRingingPushEvent } from '../StreamVideoRN/types';
|
|
5
|
+
import { PushNotificationiOSType } from './libs/iosPushNotification';
|
|
6
|
+
export type StreamPushPayload = {
|
|
7
|
+
call_cid: string;
|
|
8
|
+
type: 'call.ring' | NonRingingPushEvent;
|
|
9
|
+
sender: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
export declare function isFirebaseStreamVideoMessage(message: FirebaseMessagingTypes.RemoteMessage): boolean;
|
|
12
|
+
export declare function isNotifeeStreamVideoEvent(event: Event): boolean;
|
|
13
|
+
export declare function isExpoNotificationStreamVideoEvent(event: ExpoNotification): boolean | undefined;
|
|
14
|
+
export declare function isPushNotificationiOSStreamVideoEvent(notification: PushNotificationiOSType): boolean;
|
|
43
15
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,SAAS,CAAC;AAEd,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,sBAAsB,CAAC,aAAa,WAG9C;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAIrD;AAED,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,gBAAgB,uBAYzE;AAED,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,uBAAuB,WAKtC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.3.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "dist/commonjs/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"expo": ">=47.0.0",
|
|
66
66
|
"expo-build-properties": "*",
|
|
67
67
|
"expo-notifications": "*",
|
|
68
|
-
"expo-task-manager": "*",
|
|
69
68
|
"react": ">=17.0.0",
|
|
70
69
|
"react-native": ">=0.67.0",
|
|
71
70
|
"react-native-callkeep": ">=4.3.11",
|
|
@@ -100,9 +99,6 @@
|
|
|
100
99
|
"expo-notifications": {
|
|
101
100
|
"optional": true
|
|
102
101
|
},
|
|
103
|
-
"expo-task-manager": {
|
|
104
|
-
"optional": true
|
|
105
|
-
},
|
|
106
102
|
"react-native-callkeep": {
|
|
107
103
|
"optional": true
|
|
108
104
|
},
|
|
@@ -122,11 +118,11 @@
|
|
|
122
118
|
"@notifee/react-native": "7.8.0",
|
|
123
119
|
"@react-native-community/netinfo": "9.3.9",
|
|
124
120
|
"@react-native-community/push-notification-ios": "1.11.0",
|
|
125
|
-
"@react-native-firebase/app": "
|
|
126
|
-
"@react-native-firebase/messaging": "
|
|
121
|
+
"@react-native-firebase/app": "19.2.2",
|
|
122
|
+
"@react-native-firebase/messaging": "19.2.2",
|
|
127
123
|
"@react-native/eslint-config": "^0.74.84",
|
|
128
124
|
"@stream-io/react-native-webrtc": "118.1.0",
|
|
129
|
-
"@stream-io/video-filters-react-native": "
|
|
125
|
+
"@stream-io/video-filters-react-native": "^0.2.4",
|
|
130
126
|
"@testing-library/jest-native": "^5.4.2",
|
|
131
127
|
"@testing-library/react-native": "^12.1.2",
|
|
132
128
|
"@tsconfig/node14": "14.1.0",
|
|
@@ -139,8 +135,7 @@
|
|
|
139
135
|
"expo": "50.0.19",
|
|
140
136
|
"expo-build-properties": "^0.12.3",
|
|
141
137
|
"expo-modules-core": "1.12.16",
|
|
142
|
-
"expo-notifications": "~0.
|
|
143
|
-
"expo-task-manager": "~11.7.3",
|
|
138
|
+
"expo-notifications": "~0.28.18",
|
|
144
139
|
"jest": "^29.7.0",
|
|
145
140
|
"react-native": "0.71.8",
|
|
146
141
|
"react-native-builder-bob": "^0.23.2",
|
|
@@ -168,4 +163,4 @@
|
|
|
168
163
|
"typescript"
|
|
169
164
|
]
|
|
170
165
|
}
|
|
171
|
-
}
|
|
166
|
+
}
|
|
@@ -28,7 +28,10 @@ export const IncomingCallControls = ({
|
|
|
28
28
|
} = useTheme();
|
|
29
29
|
return (
|
|
30
30
|
<View style={[styles.buttonGroup, incomingCall.buttonGroup]}>
|
|
31
|
-
<RejectCallButton
|
|
31
|
+
<RejectCallButton
|
|
32
|
+
onPressHandler={onRejectCallHandler}
|
|
33
|
+
rejectReason="decline"
|
|
34
|
+
/>
|
|
32
35
|
<ToggleVideoPreviewButton />
|
|
33
36
|
<AcceptCallButton onPressHandler={onAcceptCallHandler} />
|
|
34
37
|
</View>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../../contexts';
|
|
4
|
-
import { HangUpCallButton } from './HangupCallButton';
|
|
5
4
|
import { ToggleAudioPreviewButton } from './ToggleAudioPreviewButton';
|
|
6
5
|
import { ToggleVideoPreviewButton } from './ToggleVideoPreviewButton';
|
|
6
|
+
import { RejectCallButton } from './RejectCallButton';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Props for the OutgoingCallControls Component.
|
|
@@ -32,9 +32,10 @@ export const OutgoingCallControls = ({
|
|
|
32
32
|
<ToggleAudioPreviewButton />
|
|
33
33
|
<ToggleVideoPreviewButton />
|
|
34
34
|
</View>
|
|
35
|
-
<
|
|
35
|
+
<RejectCallButton
|
|
36
36
|
onPressHandler={onHangupCallHandler}
|
|
37
37
|
size={buttonSizes.md}
|
|
38
|
+
rejectReason="cancel"
|
|
38
39
|
/>
|
|
39
40
|
</View>
|
|
40
41
|
);
|
|
@@ -20,16 +20,32 @@ type RejectCallButtonProps = {
|
|
|
20
20
|
* Note: If the `onPressHandler` is passed this handler will not be executed.
|
|
21
21
|
*/
|
|
22
22
|
onRejectCallHandler?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the height, width and border-radius (half the value) of the button.
|
|
25
|
+
*/
|
|
26
|
+
size?: React.ComponentProps<typeof CallControlsButton>['size'];
|
|
27
|
+
/**
|
|
28
|
+
* Optional: Reason for rejecting the call.
|
|
29
|
+
* Pass a predefined or a custom reason.
|
|
30
|
+
* There are four predefined reasons for rejecting the call:
|
|
31
|
+
- `busy` - when the callee is busy and cannot accept the call.
|
|
32
|
+
- `decline` - when the callee intentionally declines the call.
|
|
33
|
+
- `cancel` - when the caller cancels the call.
|
|
34
|
+
- `timeout` - when the **caller** or **callee** rejects the call after `auto_cancel_timeout_ms` or `incoming_call_timeout_ms` accordingly.
|
|
35
|
+
*/
|
|
36
|
+
rejectReason?: string;
|
|
23
37
|
};
|
|
24
38
|
|
|
25
39
|
/**
|
|
26
40
|
* Button to reject a call.
|
|
27
41
|
*
|
|
28
|
-
*
|
|
42
|
+
* Calls call.leave({ reject: true, reason: `OPTIONAL-REASON` }) internally.
|
|
29
43
|
*/
|
|
30
44
|
export const RejectCallButton = ({
|
|
31
45
|
onPressHandler,
|
|
32
46
|
onRejectCallHandler,
|
|
47
|
+
size,
|
|
48
|
+
rejectReason,
|
|
33
49
|
}: RejectCallButtonProps) => {
|
|
34
50
|
const call = useCall();
|
|
35
51
|
const { useCallCallingState } = useCallStateHooks();
|
|
@@ -50,7 +66,7 @@ export const RejectCallButton = ({
|
|
|
50
66
|
if (callingState === CallingState.LEFT) {
|
|
51
67
|
return;
|
|
52
68
|
}
|
|
53
|
-
await call?.leave({ reject: true });
|
|
69
|
+
await call?.leave({ reject: true, reason: rejectReason });
|
|
54
70
|
if (onRejectCallHandler) {
|
|
55
71
|
onRejectCallHandler();
|
|
56
72
|
}
|
|
@@ -64,7 +80,7 @@ export const RejectCallButton = ({
|
|
|
64
80
|
<CallControlsButton
|
|
65
81
|
onPress={rejectCallHandler}
|
|
66
82
|
color={colors.error}
|
|
67
|
-
size={buttonSizes.lg}
|
|
83
|
+
size={size ?? buttonSizes.lg}
|
|
68
84
|
// TODO: check what to do about this random style prop
|
|
69
85
|
// svgContainerStyle={theme.icon.lg}
|
|
70
86
|
style={rejectCallButton}
|
|
@@ -2,16 +2,23 @@ import { useEffect } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
voipCallkeepCallOnForegroundMap$,
|
|
4
4
|
voipPushNotificationCallCId$,
|
|
5
|
-
} from '../../utils/push/rxSubjects';
|
|
5
|
+
} from '../../utils/push/internal/rxSubjects';
|
|
6
6
|
import { RxUtils } from '@stream-io/video-client';
|
|
7
|
-
import {
|
|
8
|
-
iosCallkeepAcceptCall,
|
|
9
|
-
iosCallkeepRejectCall,
|
|
10
|
-
} from '../../utils/push/ios';
|
|
11
7
|
import { getCallKeepLib } from '../../utils/push/libs';
|
|
12
|
-
import { StreamVideoRN } from '../../utils';
|
|
8
|
+
import { StreamVideoRN } from '../../utils/StreamVideoRN';
|
|
9
|
+
import type { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
|
|
10
|
+
import {
|
|
11
|
+
clearPushWSEventSubscriptions,
|
|
12
|
+
processCallFromPushInBackground,
|
|
13
|
+
} from '../../utils/push/internal/utils';
|
|
14
|
+
import {
|
|
15
|
+
pushAcceptedIncomingCallCId$,
|
|
16
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$,
|
|
17
|
+
} from '../../utils/push/internal/rxSubjects';
|
|
13
18
|
import { Platform } from 'react-native';
|
|
14
19
|
|
|
20
|
+
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* This hook is used to listen to callkeep events and do the necessary actions
|
|
17
24
|
*/
|
|
@@ -62,3 +69,52 @@ export const useIosCallKeepEventsSetupEffect = () => {
|
|
|
62
69
|
};
|
|
63
70
|
}, []);
|
|
64
71
|
};
|
|
72
|
+
|
|
73
|
+
const iosCallkeepAcceptCall = (
|
|
74
|
+
call_cid: string | undefined,
|
|
75
|
+
callUUIDFromCallkeep: string
|
|
76
|
+
) => {
|
|
77
|
+
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
clearPushWSEventSubscriptions();
|
|
81
|
+
// to call end callkeep later if ended in app and not through callkeep
|
|
82
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$.next({
|
|
83
|
+
uuid: callUUIDFromCallkeep,
|
|
84
|
+
cid: call_cid,
|
|
85
|
+
});
|
|
86
|
+
// to process the call in the app
|
|
87
|
+
pushAcceptedIncomingCallCId$.next(call_cid);
|
|
88
|
+
// no need to keep these references anymore
|
|
89
|
+
voipCallkeepCallOnForegroundMap$.next(undefined);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const iosCallkeepRejectCall = async (
|
|
93
|
+
call_cid: string | undefined,
|
|
94
|
+
callUUIDFromCallkeep: string,
|
|
95
|
+
pushConfig: PushConfig
|
|
96
|
+
) => {
|
|
97
|
+
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
clearPushWSEventSubscriptions();
|
|
101
|
+
// no need to keep these references anymore
|
|
102
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
|
|
103
|
+
voipCallkeepCallOnForegroundMap$.next(undefined);
|
|
104
|
+
voipPushNotificationCallCId$.next(undefined);
|
|
105
|
+
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Helper function to determine if the answer/end call event from callkeep must be processed
|
|
110
|
+
* Just checks if we have a valid call_cid and acts as a type guard for call_cid
|
|
111
|
+
*/
|
|
112
|
+
const shouldProcessCallFromCallkeep = (
|
|
113
|
+
call_cid: string | undefined,
|
|
114
|
+
callUUIDFromCallkeep: string
|
|
115
|
+
): call_cid is string => {
|
|
116
|
+
if (!call_cid || !callUUIDFromCallkeep) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
@@ -7,7 +7,7 @@ import { getCallKeepLib } from '../../utils/push/libs';
|
|
|
7
7
|
import {
|
|
8
8
|
voipCallkeepAcceptedCallOnNativeDialerMap$,
|
|
9
9
|
voipCallkeepCallOnForegroundMap$,
|
|
10
|
-
} from '../../utils/push/rxSubjects';
|
|
10
|
+
} from '../../utils/push/internal/rxSubjects';
|
|
11
11
|
|
|
12
12
|
const isNonActiveCallingState = (callingState: CallingState) => {
|
|
13
13
|
return (
|
|
@@ -12,11 +12,11 @@ import { NativeModules } from 'react-native';
|
|
|
12
12
|
import {
|
|
13
13
|
canAddPushWSSubscriptionsRef,
|
|
14
14
|
shouldCallBeEnded,
|
|
15
|
-
} from '../../utils/push/utils';
|
|
15
|
+
} from '../../utils/push/internal/utils';
|
|
16
16
|
import {
|
|
17
17
|
pushUnsubscriptionCallbacks$,
|
|
18
18
|
voipPushNotificationCallCId$,
|
|
19
|
-
} from '../../utils/push/rxSubjects';
|
|
19
|
+
} from '../../utils/push/internal/rxSubjects';
|
|
20
20
|
import { RxUtils, getLogger } from '@stream-io/video-client';
|
|
21
21
|
|
|
22
22
|
let lastVoipToken = { token: '', userId: '' };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
pushAndroidBackgroundDeliveredIncomingCallCId$,
|
|
4
4
|
pushRejectedIncomingCallCId$,
|
|
5
5
|
pushTappedIncomingCallCId$,
|
|
6
|
-
} from '../../utils/push/rxSubjects';
|
|
6
|
+
} from '../../utils/push/internal/rxSubjects';
|
|
7
7
|
import { useEffect } from 'react';
|
|
8
8
|
import { StreamVideoRN } from '../../utils';
|
|
9
9
|
import {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@stream-io/video-react-bindings';
|
|
13
13
|
import { BehaviorSubject } from 'rxjs';
|
|
14
14
|
import { filter } from 'rxjs/operators';
|
|
15
|
-
import { processCallFromPush } from '../../utils/push/utils';
|
|
15
|
+
import { processCallFromPush } from '../../utils/push/internal/utils';
|
|
16
16
|
import { StreamVideoClient } from '@stream-io/video-client';
|
|
17
17
|
import type { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
|
|
18
18
|
|
|
@@ -92,11 +92,6 @@ const createCallSubscription = (
|
|
|
92
92
|
.pipe(filter(cidIsNotUndefined))
|
|
93
93
|
.subscribe(async (callCId) => {
|
|
94
94
|
await processCallFromPush(client, callCId, action, pushConfig);
|
|
95
|
-
if (action === 'accept') {
|
|
96
|
-
pushConfig.navigateAcceptCall();
|
|
97
|
-
} else if (action === 'pressed' || action === 'backgroundDelivered') {
|
|
98
|
-
pushConfig.navigateToIncomingCall();
|
|
99
|
-
}
|
|
100
95
|
behaviourSubjectWithCallCid.next(undefined); // remove the current call id to avoid processing again
|
|
101
96
|
});
|
|
102
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pushNonRingingCallData$ } from '../../utils/push/rxSubjects';
|
|
1
|
+
import { pushNonRingingCallData$ } from '../../utils/push/internal/rxSubjects';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { StreamVideoRN } from '../../utils';
|
|
4
4
|
import {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useStreamVideoClient,
|
|
7
7
|
} from '@stream-io/video-react-bindings';
|
|
8
8
|
import { filter } from 'rxjs/operators';
|
|
9
|
-
import { processNonIncomingCallFromPush } from '../../utils/push/utils';
|
|
9
|
+
import { processNonIncomingCallFromPush } from '../../utils/push/internal/utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
|
|
@@ -16,7 +16,7 @@ import { processNonIncomingCallFromPush } from '../../utils/push/utils';
|
|
|
16
16
|
export const useProcessPushNonRingingCallEffect = () => {
|
|
17
17
|
const client = useStreamVideoClient();
|
|
18
18
|
const connectedUserId = useConnectedUser()?.id;
|
|
19
|
-
// The Effect to
|
|
19
|
+
// The Effect to automatically add the non ringing call to our low level client state
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
const pushConfig = StreamVideoRN.getConfig().push;
|
|
22
22
|
if (!pushConfig || !client || !connectedUserId) {
|
|
@@ -5,7 +5,7 @@ import { useIosCallkeepWithCallingStateEffect } from '../hooks/push/useIosCallke
|
|
|
5
5
|
import {
|
|
6
6
|
canAddPushWSSubscriptionsRef,
|
|
7
7
|
clearPushWSEventSubscriptions,
|
|
8
|
-
} from '../utils/push/utils';
|
|
8
|
+
} from '../utils/push/internal/utils';
|
|
9
9
|
import { useAndroidKeepCallAliveEffect } from '../hooks/useAndroidKeepCallAliveEffect';
|
|
10
10
|
import { AppState, NativeModules, Platform } from 'react-native';
|
|
11
11
|
import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../utils/internal/shouldDisableIOSLocalVideoOnBackground';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { setupFirebaseHandlerAndroid } from '../push/android';
|
|
2
1
|
import { StreamVideoConfig } from './types';
|
|
3
2
|
import pushLogoutCallbacks from '../internal/pushLogoutCallback';
|
|
4
|
-
import { setupRemoteNotificationsHandleriOS } from '../push/ios';
|
|
5
3
|
import newNotificationCallbacks, {
|
|
6
4
|
NewCallNotificationCallback,
|
|
7
5
|
} from '../internal/newNotificationCallbacks';
|
|
@@ -66,11 +64,18 @@ export class StreamVideoRN {
|
|
|
66
64
|
// Ignoring this config as push config was already set
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
67
|
+
if (
|
|
68
|
+
__DEV__ &&
|
|
69
|
+
(pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)
|
|
70
|
+
) {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
|
|
73
|
+
Please watch for incoming and outgoing calls in the root component of your app.
|
|
74
|
+
Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
69
78
|
this.config.push = pushConfig;
|
|
70
|
-
// After getting the config we should setup callkeep events, firebase handler asap to handle incoming calls from a dead state
|
|
71
|
-
setupFirebaseHandlerAndroid(pushConfig);
|
|
72
|
-
// setup ios handler for non-voip push notifications asap
|
|
73
|
-
setupRemoteNotificationsHandleriOS(pushConfig);
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
static getConfig() {
|
|
@@ -107,10 +107,12 @@ export type StreamVideoConfig = {
|
|
|
107
107
|
* }
|
|
108
108
|
*/
|
|
109
109
|
createStreamVideoClient: () => Promise<StreamVideoClient | undefined>;
|
|
110
|
-
/**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
/** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
|
|
111
|
+
Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
|
|
112
|
+
navigateAcceptCall?: () => void;
|
|
113
|
+
/** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
|
|
114
|
+
Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
|
|
115
|
+
navigateToIncomingCall?: () => void;
|
|
114
116
|
/** Callback that is called when a non ringing push notification was tapped */
|
|
115
117
|
onTapNonRingingCallNotification?: (
|
|
116
118
|
call_cid: string,
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
|
|
2
1
|
import {
|
|
3
2
|
Call,
|
|
4
3
|
RxUtils,
|
|
@@ -12,11 +11,10 @@ import type {
|
|
|
12
11
|
} from '../StreamVideoRN/types';
|
|
13
12
|
import {
|
|
14
13
|
getFirebaseMessagingLib,
|
|
15
|
-
getFirebaseMessagingLibNoThrow,
|
|
16
14
|
getExpoNotificationsLib,
|
|
17
|
-
getExpoTaskManagerLib,
|
|
18
15
|
getNotifeeLibThrowIfNotInstalledForPush,
|
|
19
16
|
NotifeeLib,
|
|
17
|
+
FirebaseMessagingTypes,
|
|
20
18
|
} from './libs';
|
|
21
19
|
import {
|
|
22
20
|
pushAcceptedIncomingCallCId$,
|
|
@@ -25,15 +23,16 @@ import {
|
|
|
25
23
|
pushNonRingingCallData$,
|
|
26
24
|
pushUnsubscriptionCallbacks$,
|
|
27
25
|
pushAndroidBackgroundDeliveredIncomingCallCId$,
|
|
28
|
-
} from './rxSubjects';
|
|
26
|
+
} from './internal/rxSubjects';
|
|
29
27
|
import {
|
|
30
28
|
canAddPushWSSubscriptionsRef,
|
|
31
29
|
clearPushWSEventSubscriptions,
|
|
32
30
|
processCallFromPushInBackground,
|
|
33
31
|
shouldCallBeEnded,
|
|
34
|
-
} from './utils';
|
|
32
|
+
} from './internal/utils';
|
|
35
33
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
36
34
|
import { getAndroidDefaultRingtoneUrl } from '../getAndroidDefaultRingtoneUrl';
|
|
35
|
+
import { StreamVideoRN } from '../StreamVideoRN';
|
|
37
36
|
|
|
38
37
|
const ACCEPT_CALL_ACTION_ID = 'accept';
|
|
39
38
|
const DECLINE_CALL_ACTION_ID = 'decline';
|
|
@@ -48,89 +47,6 @@ type Event = Parameters<onBackgroundEventFunctionParams>[0];
|
|
|
48
47
|
|
|
49
48
|
let lastFirebaseToken = { token: '', userId: '' };
|
|
50
49
|
|
|
51
|
-
// EventType = NotifeeLib['EventType'];
|
|
52
|
-
|
|
53
|
-
/** Setup Firebase push message handler **/
|
|
54
|
-
export function setupFirebaseHandlerAndroid(pushConfig: PushConfig) {
|
|
55
|
-
if (Platform.OS !== 'android') {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (pushConfig.isExpo) {
|
|
59
|
-
const messaging = getFirebaseMessagingLibNoThrow(true);
|
|
60
|
-
if (messaging) {
|
|
61
|
-
// handles on app killed state in expo, expo-notifications cannot handle that
|
|
62
|
-
messaging().setBackgroundMessageHandler(
|
|
63
|
-
async (msg) =>
|
|
64
|
-
await firebaseMessagingOnMessageHandler(msg.data, pushConfig)
|
|
65
|
-
);
|
|
66
|
-
messaging().onMessage((msg) =>
|
|
67
|
-
firebaseMessagingOnMessageHandler(msg.data, pushConfig)
|
|
68
|
-
); // this is to listen to foreground messages, which we dont need for now
|
|
69
|
-
} else {
|
|
70
|
-
const Notifications = getExpoNotificationsLib();
|
|
71
|
-
const TaskManager = getExpoTaskManagerLib();
|
|
72
|
-
const BACKGROUND_NOTIFICATION_TASK =
|
|
73
|
-
'STREAM-VIDEO-SDK-INTERNAL-BACKGROUND-NOTIFICATION-TASK';
|
|
74
|
-
|
|
75
|
-
TaskManager.defineTask(
|
|
76
|
-
BACKGROUND_NOTIFICATION_TASK,
|
|
77
|
-
({ data, error }) => {
|
|
78
|
-
if (error) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
const dataToProcess = data.notification?.data;
|
|
83
|
-
firebaseMessagingOnMessageHandler(dataToProcess, pushConfig);
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
// background handler (does not handle on app killed state)
|
|
87
|
-
Notifications.registerTaskAsync(BACKGROUND_NOTIFICATION_TASK);
|
|
88
|
-
// foreground handler
|
|
89
|
-
Notifications.setNotificationHandler({
|
|
90
|
-
handleNotification: async (notification) => {
|
|
91
|
-
// @ts-ignore
|
|
92
|
-
const trigger = notification?.request?.trigger;
|
|
93
|
-
if (trigger.type === 'push') {
|
|
94
|
-
const data = trigger?.remoteMessage?.data;
|
|
95
|
-
if (data?.sender === 'stream.video') {
|
|
96
|
-
await firebaseMessagingOnMessageHandler(data, pushConfig);
|
|
97
|
-
return {
|
|
98
|
-
shouldShowAlert: false,
|
|
99
|
-
shouldPlaySound: false,
|
|
100
|
-
shouldSetBadge: false,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
shouldShowAlert: true,
|
|
106
|
-
shouldPlaySound: false,
|
|
107
|
-
shouldSetBadge: false,
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
const messaging = getFirebaseMessagingLib();
|
|
114
|
-
messaging().setBackgroundMessageHandler(
|
|
115
|
-
async (msg) =>
|
|
116
|
-
await firebaseMessagingOnMessageHandler(msg.data, pushConfig)
|
|
117
|
-
);
|
|
118
|
-
messaging().onMessage((msg) =>
|
|
119
|
-
firebaseMessagingOnMessageHandler(msg.data, pushConfig)
|
|
120
|
-
); // this is to listen to foreground messages, which we dont need for now
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// the notification tap handlers are always registered with notifee for both expo and non-expo in android
|
|
124
|
-
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
125
|
-
const notifee = notifeeLib.default;
|
|
126
|
-
notifee.onBackgroundEvent(async (event) => {
|
|
127
|
-
await onNotifeeEvent(event, pushConfig, true);
|
|
128
|
-
});
|
|
129
|
-
notifee.onForegroundEvent((event) => {
|
|
130
|
-
onNotifeeEvent(event, pushConfig, false);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
50
|
/** Send token to stream, create notification channel, */
|
|
135
51
|
export async function initAndroidPushToken(
|
|
136
52
|
client: StreamVideoClient,
|
|
@@ -184,10 +100,14 @@ export async function initAndroidPushToken(
|
|
|
184
100
|
}
|
|
185
101
|
}
|
|
186
102
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Creates notification from the push message data.
|
|
105
|
+
* For Ringing and Non-Ringing calls.
|
|
106
|
+
*/
|
|
107
|
+
export const firebaseDataHandler = async (
|
|
108
|
+
data: FirebaseMessagingTypes.RemoteMessage['data']
|
|
190
109
|
) => {
|
|
110
|
+
if (Platform.OS !== 'android') return;
|
|
191
111
|
/* Example data from firebase
|
|
192
112
|
"message": {
|
|
193
113
|
"data": {
|
|
@@ -203,7 +123,8 @@ const firebaseMessagingOnMessageHandler = async (
|
|
|
203
123
|
// other stuff
|
|
204
124
|
}
|
|
205
125
|
*/
|
|
206
|
-
|
|
126
|
+
const pushConfig = StreamVideoRN.getConfig().push;
|
|
127
|
+
if (!pushConfig || !data || data.sender !== 'stream.video') {
|
|
207
128
|
return;
|
|
208
129
|
}
|
|
209
130
|
|
|
@@ -377,16 +298,25 @@ const firebaseMessagingOnMessageHandler = async (
|
|
|
377
298
|
}
|
|
378
299
|
};
|
|
379
300
|
|
|
380
|
-
const
|
|
381
|
-
event
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
301
|
+
export const onAndroidNotifeeEvent = async ({
|
|
302
|
+
event,
|
|
303
|
+
isBackground,
|
|
304
|
+
}: {
|
|
305
|
+
event: Event;
|
|
306
|
+
isBackground: boolean;
|
|
307
|
+
}) => {
|
|
308
|
+
if (Platform.OS !== 'android') return;
|
|
385
309
|
const { type, detail } = event;
|
|
386
310
|
const { notification, pressAction } = detail;
|
|
387
311
|
const notificationId = notification?.id;
|
|
388
312
|
const data = notification?.data;
|
|
389
|
-
|
|
313
|
+
const pushConfig = StreamVideoRN.getConfig().push;
|
|
314
|
+
if (
|
|
315
|
+
!pushConfig ||
|
|
316
|
+
!data ||
|
|
317
|
+
!notificationId ||
|
|
318
|
+
data.sender !== 'stream.video'
|
|
319
|
+
) {
|
|
390
320
|
return;
|
|
391
321
|
}
|
|
392
322
|
|
|
@@ -443,7 +373,6 @@ const onNotifeeEvent = async (
|
|
|
443
373
|
} else {
|
|
444
374
|
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
445
375
|
if (type === notifeeLib.EventType.PRESS) {
|
|
446
|
-
pushTappedIncomingCallCId$.next(call_cid);
|
|
447
376
|
pushConfig.onTapNonRingingCallNotification?.(
|
|
448
377
|
call_cid,
|
|
449
378
|
data.type as NonRingingPushEvent
|