@stream-io/video-react-native-sdk 1.23.0 → 1.24.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 +22 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +2 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +2 -2
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -3
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js +3 -3
- package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/HangupCallButton.js +3 -3
- package/dist/commonjs/components/Call/CallControls/HangupCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js +2 -2
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +2 -2
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +2 -2
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +4 -4
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +2 -2
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +4 -4
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js +2 -2
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +2 -2
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +11 -11
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/commonjs/contexts/internal/ScreenshotIosContext.js +3 -3
- package/dist/commonjs/contexts/internal/ScreenshotIosContext.js.map +1 -1
- package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js +1 -1
- package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +2 -2
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +13 -13
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +2 -2
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +1 -1
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +10 -10
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/hooks/usePermissionRequest.js +2 -2
- package/dist/commonjs/hooks/usePermissionRequest.js.map +1 -1
- package/dist/commonjs/hooks/useScreenShareButton.js +4 -4
- package/dist/commonjs/hooks/useScreenShareButton.js.map +1 -1
- package/dist/commonjs/hooks/useScreenshot.js +2 -2
- package/dist/commonjs/hooks/useScreenshot.js.map +1 -1
- package/dist/commonjs/modules/call-manager/PrevLibDetection.js +1 -1
- package/dist/commonjs/modules/call-manager/PrevLibDetection.js.map +1 -1
- package/dist/commonjs/providers/BusyTonePlayer.js +6 -6
- package/dist/commonjs/providers/BusyTonePlayer.js.map +1 -1
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js +2 -2
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/AppStateListener.js +7 -7
- package/dist/commonjs/providers/StreamCall/AppStateListener.js.map +1 -1
- package/dist/commonjs/utils/getAndroidDefaultRingtoneUrl.js +3 -3
- package/dist/commonjs/utils/getAndroidDefaultRingtoneUrl.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +30 -30
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +9 -9
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +11 -11
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js +21 -21
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js +1 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +3 -3
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +3 -3
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +7 -7
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +4 -4
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +3 -3
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +3 -3
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -3
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallControls/AcceptCallButton.js +3 -3
- package/dist/module/components/Call/CallControls/AcceptCallButton.js.map +1 -1
- package/dist/module/components/Call/CallControls/HangupCallButton.js +3 -4
- package/dist/module/components/Call/CallControls/HangupCallButton.js.map +1 -1
- package/dist/module/components/Call/CallControls/RejectCallButton.js +3 -3
- package/dist/module/components/Call/CallControls/RejectCallButton.js.map +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +3 -3
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/module/components/Call/Lobby/JoinCallButton.js +3 -3
- package/dist/module/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +5 -5
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +3 -3
- package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +5 -5
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js +3 -4
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +3 -3
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +11 -11
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/module/contexts/internal/ScreenshotIosContext.js +4 -4
- package/dist/module/contexts/internal/ScreenshotIosContext.js.map +1 -1
- package/dist/module/hooks/push/useInitAndroidTokenAndRest.js +2 -2
- package/dist/module/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +3 -3
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +14 -14
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +3 -3
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +2 -2
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +11 -11
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/hooks/usePermissionRequest.js +3 -3
- package/dist/module/hooks/usePermissionRequest.js.map +1 -1
- package/dist/module/hooks/useScreenShareButton.js +5 -5
- package/dist/module/hooks/useScreenShareButton.js.map +1 -1
- package/dist/module/hooks/useScreenshot.js +3 -3
- package/dist/module/hooks/useScreenshot.js.map +1 -1
- package/dist/module/modules/call-manager/PrevLibDetection.js +2 -2
- package/dist/module/modules/call-manager/PrevLibDetection.js.map +1 -1
- package/dist/module/providers/BusyTonePlayer.js +7 -7
- package/dist/module/providers/BusyTonePlayer.js.map +1 -1
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js +3 -3
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/module/providers/StreamCall/AppStateListener.js +8 -8
- package/dist/module/providers/StreamCall/AppStateListener.js.map +1 -1
- package/dist/module/utils/getAndroidDefaultRingtoneUrl.js +3 -3
- package/dist/module/utils/getAndroidDefaultRingtoneUrl.js.map +1 -1
- package/dist/module/utils/push/android.js +31 -31
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +9 -9
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +12 -12
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js +22 -22
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/expoNotifications.js +2 -2
- package/dist/module/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/index.js +3 -3
- package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +3 -3
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/setupIosCallKeepEvents.js +8 -8
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/module/utils/push/setupIosVoipPushEvents.js +5 -5
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/AcceptCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/HangupCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLobby.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
- package/dist/typescript/contexts/internal/ScreenshotIosContext.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useInitAndroidTokenAndRest.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useScreenShareButton.d.ts.map +1 -1
- package/dist/typescript/hooks/useScreenshot.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/PrevLibDetection.d.ts.map +1 -1
- package/dist/typescript/providers/BusyTonePlayer.d.ts.map +1 -1
- package/dist/typescript/providers/NoiseCancellation/NoiseCancellationProvider.d.ts.map +1 -1
- package/dist/typescript/providers/StreamCall/AppStateListener.d.ts.map +1 -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/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/StreamInCallManager.swift +35 -23
- package/package.json +3 -3
- package/src/components/Call/CallContent/CallContent.tsx +7 -9
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +7 -9
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +8 -6
- package/src/components/Call/CallControls/AcceptCallButton.tsx +3 -3
- package/src/components/Call/CallControls/HangupCallButton.tsx +3 -4
- package/src/components/Call/CallControls/RejectCallButton.tsx +4 -4
- package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +6 -3
- package/src/components/Call/Lobby/JoinCallButton.tsx +3 -3
- package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +5 -5
- package/src/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx +3 -3
- package/src/components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx +5 -5
- package/src/components/Livestream/ViewerLivestream/ViewerLobby.tsx +3 -4
- package/src/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.tsx +3 -4
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +9 -10
- package/src/contexts/internal/ScreenshotIosContext.tsx +12 -14
- package/src/hooks/push/useInitAndroidTokenAndRest.ts +4 -6
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +9 -3
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +14 -19
- package/src/hooks/push/useProcessPushCallEffect.ts +11 -9
- package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +6 -5
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +17 -14
- package/src/hooks/usePermissionRequest.tsx +3 -3
- package/src/hooks/useScreenShareButton.ts +5 -7
- package/src/hooks/useScreenshot.ts +7 -11
- package/src/modules/call-manager/PrevLibDetection.ts +6 -5
- package/src/providers/BusyTonePlayer.tsx +7 -11
- package/src/providers/NoiseCancellation/NoiseCancellationProvider.tsx +7 -11
- package/src/providers/StreamCall/AppStateListener.tsx +8 -12
- package/src/utils/getAndroidDefaultRingtoneUrl.ts +3 -3
- package/src/utils/push/android.ts +93 -85
- package/src/utils/push/internal/ios.ts +9 -15
- package/src/utils/push/internal/utils.ts +28 -25
- package/src/utils/push/ios.ts +28 -32
- package/src/utils/push/libs/expoNotifications.ts +6 -5
- package/src/utils/push/libs/firebaseMessaging/index.ts +5 -4
- package/src/utils/push/libs/notifee/index.ts +3 -4
- package/src/utils/push/setupIosCallKeepEvents.ts +12 -14
- package/src/utils/push/setupIosVoipPushEvents.ts +7 -9
- package/src/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Call,
|
|
3
3
|
CallingState,
|
|
4
|
-
getLogger,
|
|
5
4
|
StreamVideoClient,
|
|
5
|
+
videoLoggerSystem,
|
|
6
6
|
} from '@stream-io/video-client';
|
|
7
7
|
import { AppState, Platform } from 'react-native';
|
|
8
8
|
import type {
|
|
@@ -59,19 +59,18 @@ export async function initAndroidPushToken(
|
|
|
59
59
|
if (Platform.OS !== 'android' || !pushConfig.android.pushProviderName) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const logger = getLogger(
|
|
62
|
+
const logger = videoLoggerSystem.getLogger('initAndroidPushToken');
|
|
63
63
|
const setDeviceToken = async (token: string) => {
|
|
64
64
|
const userId = client.streamClient._user?.id ?? '';
|
|
65
65
|
if (client.streamClient.anonymous) {
|
|
66
|
-
logger('
|
|
66
|
+
logger.debug('Skipped sending firebase token for anonymous user');
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
if (
|
|
70
70
|
lastFirebaseToken.token === token &&
|
|
71
71
|
lastFirebaseToken.userId === userId
|
|
72
72
|
) {
|
|
73
|
-
logger(
|
|
74
|
-
'debug',
|
|
73
|
+
logger.debug(
|
|
75
74
|
`Skipping setting the same token again for userId: ${userId} and token: ${token}`,
|
|
76
75
|
);
|
|
77
76
|
return;
|
|
@@ -80,14 +79,14 @@ export async function initAndroidPushToken(
|
|
|
80
79
|
setPushLogoutCallback(async () => {
|
|
81
80
|
lastFirebaseToken = { token: '', userId: '' };
|
|
82
81
|
try {
|
|
83
|
-
logger(
|
|
82
|
+
logger.debug(`Logout removeDeviceToken: ${token}`);
|
|
84
83
|
await client.removeDevice(token);
|
|
85
84
|
} catch (err) {
|
|
86
|
-
logger('
|
|
85
|
+
logger.warn('Failed to remove firebase token from stream', err);
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
const push_provider_name = pushConfig.android.pushProviderName;
|
|
90
|
-
logger(
|
|
89
|
+
logger.debug(`sending firebase token: ${token} for userId: ${userId}`);
|
|
91
90
|
await client.addDevice(token, 'firebase', push_provider_name);
|
|
92
91
|
};
|
|
93
92
|
if (pushConfig.isExpo) {
|
|
@@ -95,7 +94,7 @@ export async function initAndroidPushToken(
|
|
|
95
94
|
? getExpoNotificationsLib()
|
|
96
95
|
: getExpoNotificationsLibNoThrow();
|
|
97
96
|
if (expoNotificationsLib) {
|
|
98
|
-
logger(
|
|
97
|
+
logger.debug(`setting expo notification token listeners`);
|
|
99
98
|
const subscription = expoNotificationsLib.addPushTokenListener(
|
|
100
99
|
(devicePushToken) => {
|
|
101
100
|
setDeviceToken(devicePushToken.data);
|
|
@@ -114,7 +113,7 @@ export async function initAndroidPushToken(
|
|
|
114
113
|
? getFirebaseMessagingLibNoThrow(true)
|
|
115
114
|
: getFirebaseMessagingLib();
|
|
116
115
|
if (messaging) {
|
|
117
|
-
logger(
|
|
116
|
+
logger.debug(`setting firebase token listeners`);
|
|
118
117
|
const unsubscribe = messaging().onTokenRefresh((refreshedToken) =>
|
|
119
118
|
setDeviceToken(refreshedToken),
|
|
120
119
|
);
|
|
@@ -155,9 +154,8 @@ export const firebaseDataHandler = async (
|
|
|
155
154
|
const notifee = notifeeLib.default;
|
|
156
155
|
const settings = await notifee.getNotificationSettings();
|
|
157
156
|
if (settings.authorizationStatus !== 1) {
|
|
158
|
-
const logger = getLogger(
|
|
159
|
-
logger(
|
|
160
|
-
'debug',
|
|
157
|
+
const logger = videoLoggerSystem.getLogger('firebaseDataHandler');
|
|
158
|
+
logger.debug(
|
|
161
159
|
`Notification permission not granted, unable to post ${data.type} notifications`,
|
|
162
160
|
);
|
|
163
161
|
return;
|
|
@@ -192,20 +190,22 @@ export const firebaseDataHandler = async (
|
|
|
192
190
|
return new Promise(async () => {
|
|
193
191
|
const client = await pushConfig.createStreamVideoClient();
|
|
194
192
|
if (!client) {
|
|
195
|
-
|
|
196
|
-
'
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
videoLoggerSystem
|
|
194
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
195
|
+
.debug(
|
|
196
|
+
`Closing fg service as there is no client to create from push config`,
|
|
197
|
+
);
|
|
199
198
|
notifee.stopForegroundService();
|
|
200
199
|
return;
|
|
201
200
|
}
|
|
202
201
|
const callFromPush = await client.onRingingCall(call_cid);
|
|
203
202
|
let _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
|
|
204
203
|
if (_shouldCallBeClosed) {
|
|
205
|
-
|
|
206
|
-
'
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
videoLoggerSystem
|
|
205
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
206
|
+
.debug(
|
|
207
|
+
`Closing fg service callCid: ${call_cid} shouldCallBeClosed: ${_shouldCallBeClosed}`,
|
|
208
|
+
);
|
|
209
209
|
notifee.stopForegroundService();
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
@@ -214,22 +214,24 @@ export const firebaseDataHandler = async (
|
|
|
214
214
|
const unsubscribe = callFromPush.on('all', (event) => {
|
|
215
215
|
const _canListenToWS = canListenToWS();
|
|
216
216
|
if (!_canListenToWS) {
|
|
217
|
-
|
|
218
|
-
'
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
videoLoggerSystem
|
|
218
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
219
|
+
.debug(
|
|
220
|
+
`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`,
|
|
221
|
+
{ event },
|
|
222
|
+
);
|
|
222
223
|
unsubscribeFunctions.forEach((fn) => fn());
|
|
223
224
|
notifee.stopForegroundService();
|
|
224
225
|
return;
|
|
225
226
|
}
|
|
226
227
|
_shouldCallBeClosed = shouldCallBeClosed(callFromPush);
|
|
227
228
|
if (_shouldCallBeClosed) {
|
|
228
|
-
|
|
229
|
-
'
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
videoLoggerSystem
|
|
230
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
231
|
+
.debug(
|
|
232
|
+
`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_shouldCallBeClosed}`,
|
|
233
|
+
{ event },
|
|
234
|
+
);
|
|
233
235
|
unsubscribeFunctions.forEach((fn) => fn());
|
|
234
236
|
notifee.stopForegroundService();
|
|
235
237
|
}
|
|
@@ -241,10 +243,11 @@ export const firebaseDataHandler = async (
|
|
|
241
243
|
callingState === CallingState.IDLE ||
|
|
242
244
|
callingState === CallingState.LEFT
|
|
243
245
|
) {
|
|
244
|
-
|
|
245
|
-
'
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
videoLoggerSystem
|
|
247
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
248
|
+
.debug(
|
|
249
|
+
`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`,
|
|
250
|
+
);
|
|
248
251
|
unsubscribeFunctions.forEach((fn) => fn());
|
|
249
252
|
notifee.stopForegroundService();
|
|
250
253
|
}
|
|
@@ -261,9 +264,10 @@ export const firebaseDataHandler = async (
|
|
|
261
264
|
const incomingCallNotificationTextGetters =
|
|
262
265
|
pushConfig.android.incomingCallNotificationTextGetters;
|
|
263
266
|
if (!incomingCallChannel || !incomingCallNotificationTextGetters) {
|
|
264
|
-
const logger = getLogger(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
const logger = videoLoggerSystem.getLogger(
|
|
268
|
+
'firebaseMessagingOnMessageHandler',
|
|
269
|
+
);
|
|
270
|
+
logger.error(
|
|
267
271
|
"Can't show incoming call notification as either or both incomingCallChannel and incomingCallNotificationTextGetters were not provided",
|
|
268
272
|
);
|
|
269
273
|
return;
|
|
@@ -284,10 +288,11 @@ export const firebaseDataHandler = async (
|
|
|
284
288
|
const title = getTitle(createdUserName);
|
|
285
289
|
const body = getBody(createdUserName);
|
|
286
290
|
|
|
287
|
-
|
|
288
|
-
'
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
videoLoggerSystem
|
|
292
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
293
|
+
.debug(
|
|
294
|
+
`Displaying incoming call notification with callCid: ${call_cid} title: ${title} body: ${body} asForegroundService: ${asForegroundService}`,
|
|
295
|
+
);
|
|
291
296
|
|
|
292
297
|
const channelId = incomingCallChannel.id;
|
|
293
298
|
await notifee.displayNotification({
|
|
@@ -346,10 +351,11 @@ export const firebaseDataHandler = async (
|
|
|
346
351
|
const callFromPush = await client.onRingingCall(call_cid);
|
|
347
352
|
|
|
348
353
|
if (shouldCallBeClosed(callFromPush)) {
|
|
349
|
-
|
|
350
|
-
'
|
|
351
|
-
|
|
352
|
-
|
|
354
|
+
videoLoggerSystem
|
|
355
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
356
|
+
.debug(
|
|
357
|
+
`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`,
|
|
358
|
+
);
|
|
353
359
|
notifee.cancelDisplayedNotification(call_cid);
|
|
354
360
|
}
|
|
355
361
|
} else {
|
|
@@ -358,9 +364,10 @@ export const firebaseDataHandler = async (
|
|
|
358
364
|
const callNotificationTextGetters =
|
|
359
365
|
pushConfig.android.callNotificationTextGetters;
|
|
360
366
|
if (!callChannel || !callNotificationTextGetters) {
|
|
361
|
-
const logger = getLogger(
|
|
362
|
-
|
|
363
|
-
|
|
367
|
+
const logger = videoLoggerSystem.getLogger(
|
|
368
|
+
'firebaseMessagingOnMessageHandler',
|
|
369
|
+
);
|
|
370
|
+
logger.debug(
|
|
364
371
|
"Can't show call notification as either or both callChannel and callNotificationTextGetters is not provided",
|
|
365
372
|
);
|
|
366
373
|
return;
|
|
@@ -375,10 +382,11 @@ export const firebaseDataHandler = async (
|
|
|
375
382
|
const title = getTitle(type, createdUserName);
|
|
376
383
|
const body = getBody(type, createdUserName);
|
|
377
384
|
|
|
378
|
-
|
|
379
|
-
'
|
|
380
|
-
|
|
381
|
-
|
|
385
|
+
videoLoggerSystem
|
|
386
|
+
.getLogger('firebaseMessagingOnMessageHandler')
|
|
387
|
+
.debug(
|
|
388
|
+
`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`,
|
|
389
|
+
);
|
|
382
390
|
await notifee.displayNotification({
|
|
383
391
|
title: getTitle(type, createdUserName),
|
|
384
392
|
body: getBody(type, createdUserName),
|
|
@@ -450,53 +458,54 @@ export const onAndroidNotifeeEvent = async ({
|
|
|
450
458
|
mustDecline ||
|
|
451
459
|
type === notifeeLib.EventType.ACTION_PRESS
|
|
452
460
|
) {
|
|
453
|
-
|
|
454
|
-
'
|
|
455
|
-
|
|
456
|
-
|
|
461
|
+
videoLoggerSystem
|
|
462
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
463
|
+
.debug(
|
|
464
|
+
`clearPushWSEventSubscriptions for callCId: ${call_cid} mustAccept: ${mustAccept} mustDecline: ${mustDecline}`,
|
|
465
|
+
);
|
|
457
466
|
clearPushWSEventSubscriptions(call_cid);
|
|
458
467
|
notifee.stopForegroundService();
|
|
459
468
|
}
|
|
460
469
|
|
|
461
470
|
if (mustAccept) {
|
|
462
|
-
|
|
463
|
-
'
|
|
464
|
-
`pushAcceptedIncomingCallCId$ added with callCId: ${call_cid}
|
|
465
|
-
);
|
|
471
|
+
videoLoggerSystem
|
|
472
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
473
|
+
.debug(`pushAcceptedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
466
474
|
pushAcceptedIncomingCallCId$.next(call_cid);
|
|
467
475
|
// NOTE: accept will be handled by the app with rxjs observers as the app will go to foreground always
|
|
468
476
|
} else if (mustDecline) {
|
|
469
|
-
|
|
470
|
-
'
|
|
471
|
-
`pushRejectedIncomingCallCId$ added with callCId: ${call_cid}
|
|
472
|
-
);
|
|
477
|
+
videoLoggerSystem
|
|
478
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
479
|
+
.debug(`pushRejectedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
473
480
|
pushRejectedIncomingCallCId$.next(call_cid);
|
|
474
481
|
if (hasObservers) {
|
|
475
482
|
// if we had observers we can return here as the observers will handle the call as the app is in the foreground state
|
|
476
|
-
|
|
477
|
-
'
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
videoLoggerSystem
|
|
484
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
485
|
+
.debug(
|
|
486
|
+
`Skipped processCallFromPushInBackground for Declining call with callCId: ${call_cid} as the app is in the foreground state`,
|
|
487
|
+
);
|
|
480
488
|
return;
|
|
481
489
|
}
|
|
482
|
-
|
|
483
|
-
'
|
|
484
|
-
|
|
485
|
-
|
|
490
|
+
videoLoggerSystem
|
|
491
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
492
|
+
.debug(
|
|
493
|
+
`start processCallFromPushInBackground - Declining call with callCId: ${call_cid}`,
|
|
494
|
+
);
|
|
486
495
|
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
487
496
|
} else {
|
|
488
497
|
if (type === notifeeLib.EventType.PRESS) {
|
|
489
|
-
|
|
490
|
-
'
|
|
491
|
-
`pushTappedIncomingCallCId$ added with callCId: ${call_cid}
|
|
492
|
-
);
|
|
498
|
+
videoLoggerSystem
|
|
499
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
500
|
+
.debug(`pushTappedIncomingCallCId$ added with callCId: ${call_cid}`);
|
|
493
501
|
pushTappedIncomingCallCId$.next(call_cid);
|
|
494
502
|
// pressed state will be handled by the app with rxjs observers as the app will go to foreground always
|
|
495
503
|
} else if (isBackground && type === notifeeLib.EventType.DELIVERED) {
|
|
496
|
-
|
|
497
|
-
'
|
|
498
|
-
|
|
499
|
-
|
|
504
|
+
videoLoggerSystem
|
|
505
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
506
|
+
.debug(
|
|
507
|
+
`pushAndroidBackgroundDeliveredIncomingCallCId$ added with callCId: ${call_cid}`,
|
|
508
|
+
);
|
|
500
509
|
pushAndroidBackgroundDeliveredIncomingCallCId$.next(call_cid);
|
|
501
510
|
// background delivered state will be handled by the app with rxjs observers as processing needs to happen only when app is opened
|
|
502
511
|
}
|
|
@@ -504,10 +513,9 @@ export const onAndroidNotifeeEvent = async ({
|
|
|
504
513
|
} else {
|
|
505
514
|
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
506
515
|
if (type === notifeeLib.EventType.PRESS) {
|
|
507
|
-
|
|
508
|
-
'
|
|
509
|
-
`onTapNonRingingCallNotification with callCId: ${call_cid}
|
|
510
|
-
);
|
|
516
|
+
videoLoggerSystem
|
|
517
|
+
.getLogger('onAndroidNotifeeEvent')
|
|
518
|
+
.debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
|
|
511
519
|
pushConfig.onTapNonRingingCallNotification?.(
|
|
512
520
|
call_cid,
|
|
513
521
|
data.type as NonRingingPushEvent,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getLogger } from '@stream-io/video-client';
|
|
2
1
|
import { AppState, NativeModules, Platform } from 'react-native';
|
|
3
2
|
import { getCallKeepLib, getVoipPushNotificationLib } from '../libs';
|
|
4
3
|
import { voipPushNotificationCallCId$ } from './rxSubjects';
|
|
5
4
|
import { pushUnsubscriptionCallbacks } from './constants';
|
|
6
5
|
import { canAddPushWSSubscriptionsRef, shouldCallBeEnded } from './utils';
|
|
7
6
|
import { StreamVideoConfig } from '../../StreamVideoRN/types';
|
|
7
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
8
8
|
|
|
9
9
|
export const onVoipNotificationReceived = async (
|
|
10
10
|
notification: any,
|
|
@@ -42,12 +42,11 @@ export const onVoipNotificationReceived = async (
|
|
|
42
42
|
if (!call_cid || Platform.OS !== 'ios' || !pushConfig.ios.pushProviderName) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const logger = getLogger(
|
|
45
|
+
const logger = videoLoggerSystem.getLogger('setupIosVoipPushEvents');
|
|
46
46
|
const client = await pushConfig.createStreamVideoClient();
|
|
47
47
|
|
|
48
48
|
if (!client) {
|
|
49
|
-
logger(
|
|
50
|
-
'debug',
|
|
49
|
+
logger.debug(
|
|
51
50
|
'client not found, not processing call.ring voip push notification',
|
|
52
51
|
);
|
|
53
52
|
return;
|
|
@@ -67,11 +66,10 @@ export const onVoipNotificationReceived = async (
|
|
|
67
66
|
call_cid,
|
|
68
67
|
);
|
|
69
68
|
} catch (error) {
|
|
70
|
-
logger('
|
|
69
|
+
logger.error('Error in getting call uuid from native module', error);
|
|
71
70
|
}
|
|
72
71
|
if (!uuid) {
|
|
73
|
-
logger(
|
|
74
|
-
'error',
|
|
72
|
+
logger.error(
|
|
75
73
|
`Not processing call.ring push notification, as no uuid found for call_cid: ${call_cid}`,
|
|
76
74
|
);
|
|
77
75
|
return;
|
|
@@ -86,8 +84,7 @@ export const onVoipNotificationReceived = async (
|
|
|
86
84
|
);
|
|
87
85
|
if (mustEndCall) {
|
|
88
86
|
const callkeep = getCallKeepLib();
|
|
89
|
-
logger(
|
|
90
|
-
'debug',
|
|
87
|
+
logger.debug(
|
|
91
88
|
`callkeep.reportEndCallWithUUID for uuid: ${uuid}, call_cid: ${call_cid}, reason: ${callkeepReason}`,
|
|
92
89
|
);
|
|
93
90
|
callkeep.reportEndCallWithUUID(uuid, callkeepReason);
|
|
@@ -104,8 +101,7 @@ export const onVoipNotificationReceived = async (
|
|
|
104
101
|
const unsubscribe = callFromPush.on('all', (event) => {
|
|
105
102
|
const _canListenToWS = canListenToWS();
|
|
106
103
|
if (!_canListenToWS) {
|
|
107
|
-
logger(
|
|
108
|
-
'debug',
|
|
104
|
+
logger.debug(
|
|
109
105
|
`unsubscribe due to event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`,
|
|
110
106
|
event,
|
|
111
107
|
);
|
|
@@ -114,8 +110,7 @@ export const onVoipNotificationReceived = async (
|
|
|
114
110
|
}
|
|
115
111
|
const _closed = closeCallIfNecessary();
|
|
116
112
|
if (_closed) {
|
|
117
|
-
logger(
|
|
118
|
-
'debug',
|
|
113
|
+
logger.debug(
|
|
119
114
|
`unsubscribe due to event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_closed}`,
|
|
120
115
|
event,
|
|
121
116
|
);
|
|
@@ -128,8 +123,7 @@ export const onVoipNotificationReceived = async (
|
|
|
128
123
|
}
|
|
129
124
|
// send the info to this subject, it is listened by callkeep events
|
|
130
125
|
// callkeep events will then accept/reject the call
|
|
131
|
-
logger(
|
|
132
|
-
'debug',
|
|
126
|
+
logger.debug(
|
|
133
127
|
`call_cid:${call_cid} uuid:${uuid} received and processed from call.ring push notification`,
|
|
134
128
|
);
|
|
135
129
|
voipPushNotificationCallCId$.next(call_cid);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Call,
|
|
3
3
|
CallingState,
|
|
4
|
-
getLogger,
|
|
5
4
|
StreamVideoClient,
|
|
5
|
+
videoLoggerSystem,
|
|
6
6
|
} from '@stream-io/video-client';
|
|
7
7
|
import type {
|
|
8
8
|
NonRingingPushEvent,
|
|
@@ -56,10 +56,11 @@ export const shouldCallBeEnded = (
|
|
|
56
56
|
callkeepReason = 4;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
videoLoggerSystem
|
|
60
|
+
.getLogger('shouldCallBeEnded')
|
|
61
|
+
.debug(
|
|
62
|
+
`callCid: ${callFromPush.cid} mustEndCall: ${mustEndCall} callkeepReason: ${callkeepReason}`,
|
|
63
|
+
);
|
|
63
64
|
return { mustEndCall, callkeepReason };
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -80,8 +81,10 @@ export const processCallFromPushInBackground = async (
|
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
83
|
} catch (e) {
|
|
83
|
-
const logger = getLogger(
|
|
84
|
-
|
|
84
|
+
const logger = videoLoggerSystem.getLogger(
|
|
85
|
+
'processCallFromPushInBackground',
|
|
86
|
+
);
|
|
87
|
+
logger.error('failed to create video client', e);
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
87
90
|
await processCallFromPush(videoClient, call_cid, action, pushConfig);
|
|
@@ -104,8 +107,8 @@ export const processCallFromPush = async (
|
|
|
104
107
|
try {
|
|
105
108
|
callFromPush = await client.onRingingCall(call_cid);
|
|
106
109
|
} catch (e) {
|
|
107
|
-
const logger = getLogger(
|
|
108
|
-
logger('
|
|
110
|
+
const logger = videoLoggerSystem.getLogger('processCallFromPush');
|
|
111
|
+
logger.error('failed to fetch call from push notification', e);
|
|
109
112
|
return;
|
|
110
113
|
}
|
|
111
114
|
// note: when action was pressed or delivered, we dont need to do anything as the only thing is to do is to get the call which adds it to the client
|
|
@@ -114,27 +117,25 @@ export const processCallFromPush = async (
|
|
|
114
117
|
if (pushConfig.publishOptions) {
|
|
115
118
|
callFromPush.updatePublishOptions(pushConfig.publishOptions);
|
|
116
119
|
}
|
|
117
|
-
|
|
118
|
-
'
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
videoLoggerSystem
|
|
121
|
+
.getLogger('processCallFromPush')
|
|
122
|
+
.debug(
|
|
123
|
+
`joining call from push notification with callCid: ${callFromPush.cid}`,
|
|
124
|
+
);
|
|
121
125
|
await callFromPush.join();
|
|
122
126
|
} else if (action === 'decline') {
|
|
123
127
|
const canReject =
|
|
124
128
|
callFromPush.state.callingState === CallingState.RINGING;
|
|
125
|
-
|
|
126
|
-
'
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
videoLoggerSystem
|
|
130
|
+
.getLogger('processCallFromPush')
|
|
131
|
+
.debug(
|
|
132
|
+
`declining call from push notification with callCid: ${callFromPush.cid} reject: ${canReject}`,
|
|
133
|
+
);
|
|
129
134
|
await callFromPush.leave({ reject: canReject, reason: 'decline' });
|
|
130
135
|
}
|
|
131
136
|
} catch (e) {
|
|
132
|
-
const logger = getLogger(
|
|
133
|
-
logger(
|
|
134
|
-
'warn',
|
|
135
|
-
`failed to process ${action} call from push notification`,
|
|
136
|
-
e,
|
|
137
|
-
);
|
|
137
|
+
const logger = videoLoggerSystem.getLogger('processCallFromPush');
|
|
138
|
+
logger.warn(`failed to process ${action} call from push notification`, e);
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
141
|
|
|
@@ -162,8 +163,10 @@ export const processNonIncomingCallFromPush = async (
|
|
|
162
163
|
await callFromPush.get();
|
|
163
164
|
}
|
|
164
165
|
} catch (e) {
|
|
165
|
-
const logger = getLogger(
|
|
166
|
-
|
|
166
|
+
const logger = videoLoggerSystem.getLogger(
|
|
167
|
+
'processNonIncomingCallFromPush',
|
|
168
|
+
);
|
|
169
|
+
logger.error('failed to fetch call from push notification', e);
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
169
172
|
onNewCallNotification(callFromPush, nonRingingNotificationType);
|