@stream-io/video-react-native-sdk 1.20.16 → 1.21.1-alpha.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/android/build.gradle +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +127 -0
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/commonjs/providers/BusyTonePlayer.js +54 -0
- package/dist/commonjs/providers/BusyTonePlayer.js.map +1 -0
- package/dist/commonjs/providers/StreamCall/index.js +4 -1
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/providers/StreamVideo.js +3 -2
- package/dist/commonjs/providers/StreamVideo.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +16 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +6 -3
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/constants.js +12 -0
- package/dist/commonjs/utils/push/internal/constants.js.map +1 -0
- package/dist/commonjs/utils/push/internal/ios.js +8 -2
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +1 -6
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +4 -4
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +20 -14
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +2 -2
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/module/providers/BusyTonePlayer.js +48 -0
- package/dist/module/providers/BusyTonePlayer.js.map +1 -0
- package/dist/module/providers/StreamCall/index.js +5 -2
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/providers/StreamVideo.js +3 -2
- package/dist/module/providers/StreamVideo.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +16 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/push/android.js +8 -5
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/constants.js +6 -0
- package/dist/module/utils/push/internal/constants.js.map +1 -0
- package/dist/module/utils/push/internal/ios.js +10 -4
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +0 -5
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +5 -5
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/setupIosCallKeepEvents.js +20 -14
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/module/utils/push/setupIosVoipPushEvents.js +2 -2
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
- package/dist/typescript/providers/BusyTonePlayer.d.ts +6 -0
- package/dist/typescript/providers/BusyTonePlayer.d.ts.map +1 -0
- package/dist/typescript/providers/StreamCall/index.d.ts.map +1 -1
- package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +9 -0
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/constants.d.ts +8 -0
- package/dist/typescript/utils/push/internal/constants.d.ts.map +1 -0
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +0 -6
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/expo-config-plugin/dist/withAppDelegate.js +20 -0
- package/ios/StreamVideoReactNative.h +4 -0
- package/ios/StreamVideoReactNative.m +276 -0
- package/ios/StreamVideoReactNative.xcodeproj/project.pbxproj +29 -1
- package/ios/StreamVideoReactNative.xcodeproj/project.xcworkspace/xcuserdata/santhoshvaiyapuri.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StreamVideoReactNative.xcodeproj/xcuserdata/santhoshvaiyapuri.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +6 -6
- package/src/components/Participant/ParticipantView/VideoRenderer.tsx +1 -6
- package/src/providers/BusyTonePlayer.tsx +71 -0
- package/src/providers/StreamCall/index.tsx +7 -5
- package/src/providers/StreamVideo.tsx +4 -4
- package/src/utils/StreamVideoRN/index.ts +16 -0
- package/src/utils/StreamVideoRN/types.ts +1 -0
- package/src/utils/push/android.ts +7 -9
- package/src/utils/push/internal/constants.ts +10 -0
- package/src/utils/push/internal/ios.ts +14 -11
- package/src/utils/push/internal/rxSubjects.ts +0 -10
- package/src/utils/push/internal/utils.ts +4 -7
- package/src/utils/push/setupIosCallKeepEvents.ts +30 -19
- package/src/utils/push/setupIosVoipPushEvents.ts +2 -2
- package/src/version.ts +1 -1
- package/CHANGELOG.md +0 -2746
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { getLogger
|
|
1
|
+
import { getLogger } from '@stream-io/video-client';
|
|
2
2
|
import { AppState, NativeModules, Platform } from 'react-native';
|
|
3
3
|
import { getCallKeepLib, getVoipPushNotificationLib } from '../libs';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
voipPushNotificationCallCId$,
|
|
7
|
-
} from './rxSubjects';
|
|
4
|
+
import { voipPushNotificationCallCId$ } from './rxSubjects';
|
|
5
|
+
import { pushUnsubscriptionCallbacks } from './constants';
|
|
8
6
|
import { canAddPushWSSubscriptionsRef, shouldCallBeEnded } from './utils';
|
|
9
7
|
import { StreamVideoConfig } from '../../StreamVideoRN/types';
|
|
10
8
|
|
|
@@ -46,6 +44,7 @@ export const onVoipNotificationReceived = async (
|
|
|
46
44
|
}
|
|
47
45
|
const logger = getLogger(['setupIosVoipPushEvents']);
|
|
48
46
|
const client = await pushConfig.createStreamVideoClient();
|
|
47
|
+
|
|
49
48
|
if (!client) {
|
|
50
49
|
logger(
|
|
51
50
|
'debug',
|
|
@@ -53,6 +52,13 @@ export const onVoipNotificationReceived = async (
|
|
|
53
52
|
);
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
55
|
+
const shouldRejectCallWhenBusy = client['rejectCallWhenBusy'] ?? false;
|
|
56
|
+
if (shouldRejectCallWhenBusy) {
|
|
57
|
+
// inform the iOS native module that we should reject call when busy
|
|
58
|
+
NativeModules.StreamVideoReactNative.setShouldRejectCallWhenBusy(
|
|
59
|
+
shouldRejectCallWhenBusy,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
56
62
|
const callFromPush = await client.onRingingCall(call_cid);
|
|
57
63
|
let uuid = '';
|
|
58
64
|
try {
|
|
@@ -116,12 +122,9 @@ export const onVoipNotificationReceived = async (
|
|
|
116
122
|
unsubscribe();
|
|
117
123
|
}
|
|
118
124
|
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
pushUnsubscriptionCallbacks
|
|
122
|
-
...unsubscriptionCallbacks,
|
|
123
|
-
unsubscribe,
|
|
124
|
-
]);
|
|
125
|
+
|
|
126
|
+
pushUnsubscriptionCallbacks.get(call_cid)?.forEach((cb) => cb());
|
|
127
|
+
pushUnsubscriptionCallbacks.set(call_cid, [unsubscribe]);
|
|
125
128
|
}
|
|
126
129
|
// send the info to this subject, it is listened by callkeep events
|
|
127
130
|
// callkeep events will then accept/reject the call
|
|
@@ -69,13 +69,3 @@ export const voipCallkeepCallOnForegroundMap$ = new BehaviorSubject<
|
|
|
69
69
|
export const voipCallkeepAcceptedCallOnNativeDialerMap$ = new BehaviorSubject<
|
|
70
70
|
CallkeepMap | undefined
|
|
71
71
|
>(undefined);
|
|
72
|
-
|
|
73
|
-
type UnsubscribeCallback = () => void;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* This rxjs subject is used to store the unsubscribe callbacks (if any) of the push notification processing
|
|
77
|
-
* Note: it should be used to clear it when app processes push notification from foreground
|
|
78
|
-
*/
|
|
79
|
-
export const pushUnsubscriptionCallbacks$ = new BehaviorSubject<
|
|
80
|
-
UnsubscribeCallback[] | undefined
|
|
81
|
-
>(undefined);
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
Call,
|
|
3
3
|
CallingState,
|
|
4
4
|
getLogger,
|
|
5
|
-
RxUtils,
|
|
6
5
|
StreamVideoClient,
|
|
7
6
|
} from '@stream-io/video-client';
|
|
8
7
|
import type {
|
|
@@ -10,7 +9,7 @@ import type {
|
|
|
10
9
|
StreamVideoConfig,
|
|
11
10
|
} from '../../StreamVideoRN/types';
|
|
12
11
|
import { onNewCallNotification } from '../../internal/newNotificationCallbacks';
|
|
13
|
-
import { pushUnsubscriptionCallbacks
|
|
12
|
+
import { pushUnsubscriptionCallbacks } from './constants';
|
|
14
13
|
|
|
15
14
|
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
16
15
|
|
|
@@ -174,14 +173,12 @@ export const processNonIncomingCallFromPush = async (
|
|
|
174
173
|
* This function is used to clear all the push related WS subscriptions
|
|
175
174
|
* note: events are subscribed in push for accept/decline through WS
|
|
176
175
|
*/
|
|
177
|
-
export const clearPushWSEventSubscriptions = () => {
|
|
178
|
-
const unsubscriptionCallbacks =
|
|
179
|
-
pushUnsubscriptionCallbacks$,
|
|
180
|
-
);
|
|
176
|
+
export const clearPushWSEventSubscriptions = (call_cid: string) => {
|
|
177
|
+
const unsubscriptionCallbacks = pushUnsubscriptionCallbacks.get(call_cid);
|
|
181
178
|
if (unsubscriptionCallbacks) {
|
|
182
179
|
unsubscriptionCallbacks.forEach((cb) => cb());
|
|
180
|
+
pushUnsubscriptionCallbacks.delete(call_cid);
|
|
183
181
|
}
|
|
184
|
-
pushUnsubscriptionCallbacks$.next(undefined);
|
|
185
182
|
};
|
|
186
183
|
|
|
187
184
|
/**
|
|
@@ -37,24 +37,29 @@ export function setupIosCallKeepEvents(
|
|
|
37
37
|
const callkeep = getCallKeepLib();
|
|
38
38
|
|
|
39
39
|
async function getCallCid(callUUID: string): Promise<string | undefined> {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} catch (error) {
|
|
40
|
+
try {
|
|
41
|
+
const call_cid =
|
|
42
|
+
await NativeModules.StreamVideoReactNative.getIncomingCallCid(callUUID);
|
|
43
|
+
// in a case that voipPushNotificationCallCId$ is empty (this should not happen as voipPushNotificationCallCId$ is updated in push reception)]
|
|
44
|
+
// update it with this call_cid
|
|
45
|
+
const voipPushNotificationCallCId = RxUtils.getCurrentValue(
|
|
46
|
+
voipPushNotificationCallCId$,
|
|
47
|
+
);
|
|
48
|
+
if (!voipPushNotificationCallCId) {
|
|
50
49
|
logger(
|
|
51
50
|
'debug',
|
|
52
|
-
|
|
53
|
-
error,
|
|
51
|
+
`voipPushNotificationCallCId$ is empty, updating it with the call_cid: ${call_cid} for callUUID: ${callUUID}`,
|
|
54
52
|
);
|
|
53
|
+
voipPushNotificationCallCId$.next(call_cid);
|
|
55
54
|
}
|
|
55
|
+
return call_cid;
|
|
56
|
+
} catch {
|
|
57
|
+
logger(
|
|
58
|
+
'debug',
|
|
59
|
+
`Error in getting call cid from native module for callUUID: ${callUUID} - probably the call was already processed, so ignoring this callkeep event`,
|
|
60
|
+
);
|
|
56
61
|
}
|
|
57
|
-
return
|
|
62
|
+
return undefined;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
function answerCall(callUUID: string) {
|
|
@@ -150,7 +155,7 @@ const iosCallkeepAcceptCall = (
|
|
|
150
155
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
151
156
|
return;
|
|
152
157
|
}
|
|
153
|
-
clearPushWSEventSubscriptions();
|
|
158
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
154
159
|
// to call end callkeep later if ended in app and not through callkeep
|
|
155
160
|
voipCallkeepAcceptedCallOnNativeDialerMap$.next({
|
|
156
161
|
uuid: callUUIDFromCallkeep,
|
|
@@ -170,11 +175,17 @@ const iosCallkeepRejectCall = async (
|
|
|
170
175
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
171
176
|
return;
|
|
172
177
|
}
|
|
173
|
-
clearPushWSEventSubscriptions();
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
179
|
+
// remove the references if the call_cid matches
|
|
180
|
+
const voipPushNotificationCallCId = RxUtils.getCurrentValue(
|
|
181
|
+
voipPushNotificationCallCId$,
|
|
182
|
+
);
|
|
183
|
+
if (voipPushNotificationCallCId === call_cid) {
|
|
184
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
|
|
185
|
+
voipCallkeepCallOnForegroundMap$.next(undefined);
|
|
186
|
+
voipPushNotificationCallCId$.next(undefined);
|
|
187
|
+
}
|
|
188
|
+
|
|
178
189
|
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
179
190
|
await NativeModules.StreamVideoReactNative?.removeIncomingCall(call_cid);
|
|
180
191
|
};
|
|
@@ -13,11 +13,11 @@ export function setupIosVoipPushEvents(
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const logger = getLogger(['setupIosVoipPushEvents']);
|
|
16
|
-
if (!pushConfig.
|
|
16
|
+
if (!pushConfig.ios.pushProviderName) {
|
|
17
17
|
// TODO: remove this check and find a better way once we have telecom integration for android
|
|
18
18
|
logger(
|
|
19
19
|
'debug',
|
|
20
|
-
'
|
|
20
|
+
'ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents',
|
|
21
21
|
);
|
|
22
22
|
return;
|
|
23
23
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.21.0';
|