@stream-io/video-react-native-sdk 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -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/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/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/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 +10 -2
- 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/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
package/src/utils/push/ios.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getPushNotificationIosLib,
|
|
9
9
|
type PushNotificationiOSType,
|
|
10
10
|
} from './libs';
|
|
11
|
-
import {
|
|
11
|
+
import { StreamVideoClient, videoLoggerSystem } from '@stream-io/video-client';
|
|
12
12
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
13
13
|
import type { Event } from '@notifee/react-native';
|
|
14
14
|
import { StreamVideoRN } from '../StreamVideoRN';
|
|
@@ -27,8 +27,10 @@ function processNonRingingNotificationStreamPayload(
|
|
|
27
27
|
) {
|
|
28
28
|
const cid = streamPayload.call_cid;
|
|
29
29
|
const type = streamPayload.type;
|
|
30
|
-
const logger = getLogger(
|
|
31
|
-
|
|
30
|
+
const logger = videoLoggerSystem.getLogger(
|
|
31
|
+
'processNonRingingNotificationStreamPayload',
|
|
32
|
+
);
|
|
33
|
+
logger.trace(`cid, type - ${cid}, ${type}`);
|
|
32
34
|
pushNonRingingCallData$.next({ cid, type });
|
|
33
35
|
return { cid, type };
|
|
34
36
|
}
|
|
@@ -47,9 +49,10 @@ export const oniOSExpoNotificationEvent = (event: ExpoNotification) => {
|
|
|
47
49
|
trigger.payload?.stream
|
|
48
50
|
) {
|
|
49
51
|
const streamPayload = trigger.payload.stream as StreamPushPayload;
|
|
50
|
-
const logger = getLogger(
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const logger = videoLoggerSystem.getLogger(
|
|
53
|
+
'processNonRingingNotificationStreamPayload',
|
|
54
|
+
);
|
|
55
|
+
logger.trace(
|
|
53
56
|
`processNonRingingNotificationStreamPayload - ${JSON.stringify(
|
|
54
57
|
streamPayload,
|
|
55
58
|
)}`,
|
|
@@ -75,9 +78,8 @@ export const oniOSNotifeeEvent = ({
|
|
|
75
78
|
| undefined;
|
|
76
79
|
const result = processNonRingingNotificationStreamPayload(streamPayload);
|
|
77
80
|
if (result) {
|
|
78
|
-
const logger = getLogger(
|
|
79
|
-
logger(
|
|
80
|
-
'debug',
|
|
81
|
+
const logger = videoLoggerSystem.getLogger('oniOSNotifeeEvent');
|
|
82
|
+
logger.debug(
|
|
81
83
|
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
82
84
|
);
|
|
83
85
|
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
@@ -91,10 +93,11 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
91
93
|
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
92
94
|
const data = notification.getData();
|
|
93
95
|
const streamPayload = data?.stream as StreamPushPayload;
|
|
94
|
-
const logger = getLogger(
|
|
96
|
+
const logger = videoLoggerSystem.getLogger(
|
|
97
|
+
'onPushNotificationiOSStreamVideoEvent',
|
|
98
|
+
);
|
|
95
99
|
if (!streamPayload) {
|
|
96
|
-
logger(
|
|
97
|
-
'trace',
|
|
100
|
+
logger.trace(
|
|
98
101
|
`skipping process: no stream payload found in notification data - ${JSON.stringify(
|
|
99
102
|
data,
|
|
100
103
|
)}`,
|
|
@@ -104,8 +107,7 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
104
107
|
const isClicked = data.userInteraction === 1;
|
|
105
108
|
const pushConfig = StreamVideoRN.getConfig().push;
|
|
106
109
|
if (!isClicked || !pushConfig) {
|
|
107
|
-
logger(
|
|
108
|
-
'debug',
|
|
110
|
+
logger.debug(
|
|
109
111
|
`notification.finish called and returning - isClicked: ${isClicked}, pushConfig: ${!!pushConfig}`,
|
|
110
112
|
);
|
|
111
113
|
notification.finish(pushNotificationIosLib.FetchResult.NoData);
|
|
@@ -114,8 +116,7 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
114
116
|
// listen to foreground notifications
|
|
115
117
|
const result = processNonRingingNotificationStreamPayload(streamPayload);
|
|
116
118
|
if (result) {
|
|
117
|
-
logger(
|
|
118
|
-
'debug',
|
|
119
|
+
logger.debug(
|
|
119
120
|
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
120
121
|
);
|
|
121
122
|
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
@@ -137,12 +138,11 @@ export async function initIosNonVoipToken(
|
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
const logger = getLogger(
|
|
141
|
+
const logger = videoLoggerSystem.getLogger('initIosNonVoipToken');
|
|
141
142
|
const setDeviceToken = async (token: string) => {
|
|
142
143
|
const userId = client.streamClient._user?.id ?? '';
|
|
143
144
|
if (lastApnToken.token === token && lastApnToken.userId === userId) {
|
|
144
|
-
logger(
|
|
145
|
-
'debug',
|
|
145
|
+
logger.debug(
|
|
146
146
|
'Skipped sending device token to stream as it was already sent',
|
|
147
147
|
token,
|
|
148
148
|
);
|
|
@@ -151,33 +151,31 @@ export async function initIosNonVoipToken(
|
|
|
151
151
|
setPushLogoutCallback(async () => {
|
|
152
152
|
lastApnToken = { token: '', userId: '' };
|
|
153
153
|
try {
|
|
154
|
-
logger('
|
|
154
|
+
logger.debug('Remove device token - setPushLogoutCallback', token);
|
|
155
155
|
await client.removeDevice(token);
|
|
156
156
|
} catch (err) {
|
|
157
|
-
logger(
|
|
158
|
-
'warn',
|
|
157
|
+
logger.warn(
|
|
159
158
|
'setPushLogoutCallback - Failed to remove apn token from stream',
|
|
160
159
|
err,
|
|
161
160
|
);
|
|
162
161
|
}
|
|
163
162
|
});
|
|
164
163
|
const push_provider_name = pushConfig.ios.pushProviderName;
|
|
165
|
-
logger('
|
|
164
|
+
logger.debug('Add device token to stream', token);
|
|
166
165
|
await client
|
|
167
166
|
.addDevice(token, 'apn', push_provider_name)
|
|
168
167
|
.then(() => {
|
|
169
168
|
lastApnToken = { token, userId };
|
|
170
169
|
})
|
|
171
170
|
.catch((err) => {
|
|
172
|
-
logger('
|
|
171
|
+
logger.warn('Failed to add apn token to stream', err);
|
|
173
172
|
});
|
|
174
173
|
};
|
|
175
174
|
if (pushConfig.isExpo) {
|
|
176
175
|
const expoNotificationsLib = getExpoNotificationsLib();
|
|
177
176
|
if (expoNotificationsLib) {
|
|
178
177
|
expoNotificationsLib.getDevicePushTokenAsync().then((devicePushToken) => {
|
|
179
|
-
logger(
|
|
180
|
-
'debug',
|
|
178
|
+
logger.debug(
|
|
181
179
|
'Got device token - expoNotificationsLib.getDevicePushTokenAsync',
|
|
182
180
|
devicePushToken.data,
|
|
183
181
|
);
|
|
@@ -185,8 +183,7 @@ export async function initIosNonVoipToken(
|
|
|
185
183
|
});
|
|
186
184
|
const subscription = expoNotificationsLib.addPushTokenListener(
|
|
187
185
|
(devicePushToken) => {
|
|
188
|
-
logger(
|
|
189
|
-
'debug',
|
|
186
|
+
logger.debug(
|
|
190
187
|
'Got device token - expoNotificationsLib.addPushTokenListener',
|
|
191
188
|
devicePushToken.data,
|
|
192
189
|
);
|
|
@@ -194,22 +191,21 @@ export async function initIosNonVoipToken(
|
|
|
194
191
|
},
|
|
195
192
|
);
|
|
196
193
|
setUnsubscribeListener(() => {
|
|
197
|
-
logger(
|
|
194
|
+
logger.debug(`removed expo addPushTokenListener`);
|
|
198
195
|
subscription.remove();
|
|
199
196
|
});
|
|
200
197
|
}
|
|
201
198
|
} else {
|
|
202
199
|
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
203
200
|
pushNotificationIosLib.addEventListener('register', (token) => {
|
|
204
|
-
logger(
|
|
205
|
-
'debug',
|
|
201
|
+
logger.debug(
|
|
206
202
|
`Got device token - pushNotificationIosLib.addEventListener('register')`,
|
|
207
203
|
token,
|
|
208
204
|
);
|
|
209
205
|
setDeviceToken(token);
|
|
210
206
|
});
|
|
211
207
|
setUnsubscribeListener(() => {
|
|
212
|
-
logger(
|
|
208
|
+
logger.debug(`pushNotificationIosLib.removeEventListener('register')`);
|
|
213
209
|
pushNotificationIosLib.removeEventListener('register');
|
|
214
210
|
});
|
|
215
211
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getLogger } from '@stream-io/video-client';
|
|
2
1
|
import type { Notification } from 'expo-notifications';
|
|
2
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
3
3
|
|
|
4
4
|
export type ExpoNotificationsLib = typeof import('expo-notifications');
|
|
5
5
|
|
|
@@ -22,10 +22,11 @@ export function getExpoNotificationsLib() {
|
|
|
22
22
|
|
|
23
23
|
export function getExpoNotificationsLibNoThrow() {
|
|
24
24
|
if (!expoNotificationsLib) {
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
videoLoggerSystem
|
|
26
|
+
.getLogger('getExpoNotificationsLibNoThrow')
|
|
27
|
+
.debug(
|
|
28
|
+
'expo-notifications library is not installed. It is required for non ringing push notifications and not for ringing',
|
|
29
|
+
);
|
|
29
30
|
}
|
|
30
31
|
return expoNotificationsLib;
|
|
31
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getLogger } from '@stream-io/video-client';
|
|
2
1
|
import { lib, type Type } from './lib';
|
|
2
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
3
3
|
|
|
4
4
|
export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
|
|
5
5
|
export type FirebaseMessagingType = Type;
|
|
@@ -19,9 +19,10 @@ export function getFirebaseMessagingLib() {
|
|
|
19
19
|
|
|
20
20
|
export function getFirebaseMessagingLibNoThrow(isExpo: boolean) {
|
|
21
21
|
if (!lib) {
|
|
22
|
-
const logger = getLogger(
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const logger = videoLoggerSystem.getLogger(
|
|
23
|
+
'getFirebaseMessagingLibNoThrow',
|
|
24
|
+
);
|
|
25
|
+
logger.debug(
|
|
25
26
|
`${
|
|
26
27
|
isExpo
|
|
27
28
|
? 'In Expo, @react-native-firebase/messaging library is required to receive ringing notifications in app killed state for Android.'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getLogger } from '@stream-io/video-client';
|
|
2
1
|
import { PermissionsAndroid } from 'react-native';
|
|
3
2
|
import { lib, type Type } from './lib';
|
|
3
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
4
4
|
|
|
5
5
|
export type NotifeeLib = Type;
|
|
6
6
|
|
|
@@ -37,9 +37,8 @@ export function getNotifeeLibThrowIfNotInstalledForPush() {
|
|
|
37
37
|
|
|
38
38
|
export function getNotifeeLibNoThrowForKeepCallAlive() {
|
|
39
39
|
if (!lib) {
|
|
40
|
-
const logger = getLogger(
|
|
41
|
-
logger(
|
|
42
|
-
'info',
|
|
40
|
+
const logger = videoLoggerSystem.getLogger('getNotifeeLibNoThrow');
|
|
41
|
+
logger.info(
|
|
43
42
|
`${'@notifee/react-native library not installed. It is required to keep call alive in the background for Android. '}${INSTALLATION_INSTRUCTION}`,
|
|
44
43
|
);
|
|
45
44
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
voipCallkeepCallOnForegroundMap$,
|
|
5
5
|
voipPushNotificationCallCId$,
|
|
6
6
|
} from './internal/rxSubjects';
|
|
7
|
-
import {
|
|
7
|
+
import { RxUtils, videoLoggerSystem } from '@stream-io/video-client';
|
|
8
8
|
import { getCallKeepLib, getVoipPushNotificationLib } from './libs';
|
|
9
9
|
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
10
10
|
import {
|
|
@@ -27,13 +27,14 @@ export function setupIosCallKeepEvents(
|
|
|
27
27
|
}
|
|
28
28
|
if (!pushConfig.android.incomingCallChannel) {
|
|
29
29
|
// TODO: remove this check and find a better way once we have telecom integration for android
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
videoLoggerSystem
|
|
31
|
+
.getLogger('setupIosCallKeepEvents')
|
|
32
|
+
.debug(
|
|
33
|
+
'android incomingCallChannel is not defined, so skipping the setupIosCallKeepEvents',
|
|
34
|
+
);
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
|
-
const logger = getLogger(
|
|
37
|
+
const logger = videoLoggerSystem.getLogger('setupIosCallKeepEvents');
|
|
37
38
|
const callkeep = getCallKeepLib();
|
|
38
39
|
|
|
39
40
|
async function getCallCid(callUUID: string): Promise<string | undefined> {
|
|
@@ -46,16 +47,14 @@ export function setupIosCallKeepEvents(
|
|
|
46
47
|
voipPushNotificationCallCId$,
|
|
47
48
|
);
|
|
48
49
|
if (!voipPushNotificationCallCId) {
|
|
49
|
-
logger(
|
|
50
|
-
'debug',
|
|
50
|
+
logger.debug(
|
|
51
51
|
`voipPushNotificationCallCId$ is empty, updating it with the call_cid: ${call_cid} for callUUID: ${callUUID}`,
|
|
52
52
|
);
|
|
53
53
|
voipPushNotificationCallCId$.next(call_cid);
|
|
54
54
|
}
|
|
55
55
|
return call_cid;
|
|
56
56
|
} catch {
|
|
57
|
-
logger(
|
|
58
|
-
'debug',
|
|
57
|
+
logger.debug(
|
|
59
58
|
`Error in getting call cid from native module for callUUID: ${callUUID} - probably the call was already processed, so ignoring this callkeep event`,
|
|
60
59
|
);
|
|
61
60
|
}
|
|
@@ -64,14 +63,14 @@ export function setupIosCallKeepEvents(
|
|
|
64
63
|
|
|
65
64
|
function answerCall(callUUID: string) {
|
|
66
65
|
getCallCid(callUUID).then((call_cid) => {
|
|
67
|
-
logger(
|
|
66
|
+
logger.debug(`answerCall event with call_cid: ${call_cid}`);
|
|
68
67
|
iosCallkeepAcceptCall(call_cid, callUUID);
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
function endCall(callUUID: string) {
|
|
73
72
|
getCallCid(callUUID).then((call_cid) => {
|
|
74
|
-
logger(
|
|
73
|
+
logger.debug(`endCall event with call_cid: ${call_cid}`);
|
|
75
74
|
iosCallkeepRejectCall(call_cid, callUUID, pushConfig!);
|
|
76
75
|
});
|
|
77
76
|
}
|
|
@@ -80,8 +79,7 @@ export function setupIosCallKeepEvents(
|
|
|
80
79
|
const voipPushNotification = getVoipPushNotificationLib();
|
|
81
80
|
// @ts-expect-error - call_cid is not part of RNCallKeepEventPayload
|
|
82
81
|
const call_cid = payload?.call_cid as string | undefined;
|
|
83
|
-
logger(
|
|
84
|
-
'debug',
|
|
82
|
+
logger.debug(
|
|
85
83
|
`didDisplayIncomingCall event with callUUID: ${callUUID} call_cid: ${call_cid}`,
|
|
86
84
|
);
|
|
87
85
|
if (call_cid) {
|
|
@@ -3,8 +3,8 @@ import { getVoipPushNotificationLib } from './libs';
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { onVoipNotificationReceived } from './internal/ios';
|
|
5
5
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
6
|
-
import { getLogger } from '@stream-io/video-client';
|
|
7
6
|
import { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
7
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
8
8
|
|
|
9
9
|
export function setupIosVoipPushEvents(
|
|
10
10
|
pushConfig: NonNullable<StreamVideoConfig['push']>,
|
|
@@ -12,26 +12,24 @@ export function setupIosVoipPushEvents(
|
|
|
12
12
|
if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
const logger = getLogger(
|
|
15
|
+
const logger = videoLoggerSystem.getLogger('setupIosVoipPushEvents');
|
|
16
16
|
if (!pushConfig.ios.pushProviderName) {
|
|
17
17
|
// TODO: remove this check and find a better way once we have telecom integration for android
|
|
18
|
-
logger(
|
|
19
|
-
'debug',
|
|
18
|
+
logger.debug(
|
|
20
19
|
'ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents',
|
|
21
20
|
);
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
23
|
const voipPushNotification = getVoipPushNotificationLib();
|
|
25
24
|
|
|
26
|
-
logger('
|
|
25
|
+
logger.debug('notification event listener added');
|
|
27
26
|
voipPushNotification.addEventListener('notification', (notification) => {
|
|
28
27
|
onVoipNotificationReceived(notification, pushConfig);
|
|
29
28
|
});
|
|
30
29
|
setPushLogoutCallback(async () => {
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
'notification event listener removed'
|
|
34
|
-
);
|
|
30
|
+
videoLoggerSystem
|
|
31
|
+
.getLogger('setPushLogoutCallback')
|
|
32
|
+
.debug('notification event listener removed');
|
|
35
33
|
voipPushNotification.removeEventListener('notification');
|
|
36
34
|
});
|
|
37
35
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.24.0';
|