@stream-io/video-react-native-sdk 1.21.0 → 1.21.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 +11 -0
- package/dist/commonjs/providers/StreamCall/index.js +4 -1
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +4 -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 +3 -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/version.js +1 -1
- package/dist/module/providers/StreamCall/index.js +5 -2
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/utils/push/android.js +6 -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 +5 -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/version.js +1 -1
- package/dist/typescript/providers/StreamCall/index.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/package.json +3 -3
- package/src/providers/StreamCall/index.tsx +7 -5
- package/src/utils/push/android.ts +4 -9
- package/src/utils/push/internal/constants.ts +10 -0
- package/src/utils/push/internal/ios.ts +6 -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/version.ts +1 -1
|
@@ -1,7 +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 {
|
|
4
|
+
import { voipPushNotificationCallCId$ } from './rxSubjects';
|
|
5
|
+
import { pushUnsubscriptionCallbacks } from './constants';
|
|
5
6
|
import { canAddPushWSSubscriptionsRef, shouldCallBeEnded } from './utils';
|
|
6
7
|
export const onVoipNotificationReceived = async (notification, pushConfig) => {
|
|
7
8
|
/* --- Example payload ---
|
|
@@ -91,8 +92,8 @@ export const onVoipNotificationReceived = async (notification, pushConfig) => {
|
|
|
91
92
|
unsubscribe();
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
|
-
|
|
95
|
-
pushUnsubscriptionCallbacks
|
|
95
|
+
pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
|
|
96
|
+
pushUnsubscriptionCallbacks.set(call_cid, [unsubscribe]);
|
|
96
97
|
}
|
|
97
98
|
// send the info to this subject, it is listened by callkeep events
|
|
98
99
|
// callkeep events will then accept/reject the call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getLogger","
|
|
1
|
+
{"version":3,"names":["getLogger","AppState","NativeModules","Platform","getCallKeepLib","getVoipPushNotificationLib","voipPushNotificationCallCId$","pushUnsubscriptionCallbacks","canAddPushWSSubscriptionsRef","shouldCallBeEnded","onVoipNotificationReceived","notification","pushConfig","sender","stream","type","call_cid","OS","ios","pushProviderName","logger","client","createStreamVideoClient","shouldRejectCallWhenBusy","StreamVideoReactNative","setShouldRejectCallWhenBusy","callFromPush","onRingingCall","uuid","getIncomingCallUUid","error","created_by_id","receiver_id","closeCallIfNecessary","mustEndCall","callkeepReason","callkeep","reportEndCallWithUUID","voipPushNotification","onVoipNotificationCompleted","closed","canListenToWS","current","currentState","unsubscribe","on","event","_canListenToWS","_closed","get","forEach","cb","set","next"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/ios.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,yBAAyB;AACnD,SAASC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAChE,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,SAAS;AACpE,SAASC,4BAA4B,QAAQ,cAAc;AAC3D,SAASC,2BAA2B,QAAQ,aAAa;AACzD,SAASC,4BAA4B,EAAEC,iBAAiB,QAAQ,SAAS;AAGzE,OAAO,MAAMC,0BAA0B,GAAG,MAAAA,CACxCC,YAAiB,EACjBC,UAAkD,KAC/C;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,MAAM,GAAGF,YAAY,EAAEG,MAAM,EAAED,MAAM;EAC3C,MAAME,IAAI,GAAGJ,YAAY,EAAEG,M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E,IAAKA,EAAE,CAAC,CAAC,CAAC;IAChE5C,2BAA2B,CAAC6C,GAAG,CAACpC,QAAQ,EAAE,CAAC4B,WAAW,CAAC,CAAC;EAC1D;EACA;EACA;EACAxB,MAAM,CACJ,OAAO,EACP,YAAYJ,QAAQ,SAASY,IAAI,0DACnC,CAAC;EACDtB,4BAA4B,CAAC+C,IAAI,CAACrC,QAAQ,CAAC;AAC7C,CAAC","ignoreList":[]}
|
|
@@ -48,9 +48,4 @@ export const voipCallkeepCallOnForegroundMap$ = new BehaviorSubject(undefined);
|
|
|
48
48
|
* This rxjs subject should only used to store the CallkeepMap when it was accepted in the native dialer
|
|
49
49
|
*/
|
|
50
50
|
export const voipCallkeepAcceptedCallOnNativeDialerMap$ = new BehaviorSubject(undefined);
|
|
51
|
-
/**
|
|
52
|
-
* This rxjs subject is used to store the unsubscribe callbacks (if any) of the push notification processing
|
|
53
|
-
* Note: it should be used to clear it when app processes push notification from foreground
|
|
54
|
-
*/
|
|
55
|
-
export const pushUnsubscriptionCallbacks$ = new BehaviorSubject(undefined);
|
|
56
51
|
//# sourceMappingURL=rxSubjects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined","pushAcceptedIncomingCallCId$","pushTappedIncomingCallCId$","pushAndroidBackgroundDeliveredIncomingCallCId$","pushRejectedIncomingCallCId$","voipPushNotificationCallCId$","voipCallkeepCallOnForegroundMap$","voipCallkeepAcceptedCallOnNativeDialerMap$"
|
|
1
|
+
{"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined","pushAcceptedIncomingCallCId$","pushTappedIncomingCallCId$","pushAndroidBackgroundDeliveredIncomingCallCId$","pushRejectedIncomingCallCId$","voipPushNotificationCallCId$","voipCallkeepCallOnForegroundMap$","voipCallkeepAcceptedCallOnNativeDialerMap$"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,MAAM;AAGtC;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAID,eAAe,CAExDE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAG,IAAIH,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAME,0BAA0B,GAAG,IAAIJ,eAAe,CAE3DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,8CAA8C,GACzD,IAAIL,eAAe,CAAqBE,SAAS,CAAC;;AAEpD;AACA;AACA;AACA;AACA,OAAO,MAAMI,4BAA4B,GAAG,IAAIN,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA,OAAO,MAAMK,4BAA4B,GAAG,IAAIP,eAAe,CAE7DE,SAAS,CAAC;;AAEZ;;AAMA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,gCAAgC,GAAG,IAAIR,eAAe,CAEjEE,SAAS,CAAC;;AAEZ;AACA;AACA;AACA,OAAO,MAAMO,0CAA0C,GAAG,IAAIT,eAAe,CAE3EE,SAAS,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CallingState, getLogger
|
|
1
|
+
import { CallingState, getLogger } from '@stream-io/video-client';
|
|
2
2
|
import { onNewCallNotification } from '../../internal/newNotificationCallbacks';
|
|
3
|
-
import { pushUnsubscriptionCallbacks
|
|
3
|
+
import { pushUnsubscriptionCallbacks } from './constants';
|
|
4
4
|
/**
|
|
5
5
|
* This function is used to check if the call should be ended based on the push notification
|
|
6
6
|
* Useful for callkeep management to end the call if necessary (with reportEndCallWithUUID)
|
|
@@ -133,12 +133,12 @@ export const processNonIncomingCallFromPush = async (client, call_cid, nonRingin
|
|
|
133
133
|
* This function is used to clear all the push related WS subscriptions
|
|
134
134
|
* note: events are subscribed in push for accept/decline through WS
|
|
135
135
|
*/
|
|
136
|
-
export const clearPushWSEventSubscriptions =
|
|
137
|
-
const unsubscriptionCallbacks =
|
|
136
|
+
export const clearPushWSEventSubscriptions = call_cid => {
|
|
137
|
+
const unsubscriptionCallbacks = pushUnsubscriptionCallbacks.get(call_cid);
|
|
138
138
|
if (unsubscriptionCallbacks) {
|
|
139
139
|
unsubscriptionCallbacks.forEach(cb => cb());
|
|
140
|
+
pushUnsubscriptionCallbacks.delete(call_cid);
|
|
140
141
|
}
|
|
141
|
-
pushUnsubscriptionCallbacks$.next(undefined);
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CallingState","getLogger","
|
|
1
|
+
{"version":3,"names":["CallingState","getLogger","onNewCallNotification","pushUnsubscriptionCallbacks","shouldCallBeEnded","callFromPush","created_by_id","receiver_id","callSession","state","session","rejected_by","accepted_by","mustEndCall","callkeepReason","cid","processCallFromPushInBackground","pushConfig","call_cid","action","videoClient","createStreamVideoClient","e","logger","processCallFromPush","client","onRingingCall","publishOptions","updatePublishOptions","join","canReject","callingState","RINGING","leave","reject","reason","processNonIncomingCallFromPush","nonRingingNotificationType","_callFromPush","calls","find","c","callType","callId","split","call","get","clearPushWSEventSubscriptions","unsubscriptionCallbacks","forEach","cb","delete","canAddPushWSSubscriptionsRef","current"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/utils.ts"],"mappings":"AAAA,SAEEA,YAAY,EACZC,SAAS,QAEJ,yBAAyB;AAKhC,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,2BAA2B,QAAQ,aAAa;AAMzD;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,YAAkB,EAClBC,aAAiC,EACjCC,WAA+B,KAC5B;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,WAAW,GAAGH,YAAY,CAACI,KAAK,CAACC,OAAO;EAC9C,MAAMC,WAAW,GAAGH,WAAW,EAAEG,WAAW;EAC5C,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,OAAO,MAAMkC,4BAA0D,GAAG;EACxEC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -19,17 +19,20 @@ export function setupIosCallKeepEvents(pushConfig) {
|
|
|
19
19
|
const logger = getLogger(['setupIosCallKeepEvents']);
|
|
20
20
|
const callkeep = getCallKeepLib();
|
|
21
21
|
async function getCallCid(callUUID) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
try {
|
|
23
|
+
const call_cid = await NativeModules.StreamVideoReactNative.getIncomingCallCid(callUUID);
|
|
24
|
+
// in a case that voipPushNotificationCallCId$ is empty (this should not happen as voipPushNotificationCallCId$ is updated in push reception)]
|
|
25
|
+
// update it with this call_cid
|
|
26
|
+
const voipPushNotificationCallCId = RxUtils.getCurrentValue(voipPushNotificationCallCId$);
|
|
27
|
+
if (!voipPushNotificationCallCId) {
|
|
28
|
+
logger('debug', `voipPushNotificationCallCId$ is empty, updating it with the call_cid: ${call_cid} for callUUID: ${callUUID}`);
|
|
27
29
|
voipPushNotificationCallCId$.next(call_cid);
|
|
28
|
-
} catch (error) {
|
|
29
|
-
logger('debug', 'Error in getting call cid from native module - probably the call was already processed, so ignoring this callkeep event', error);
|
|
30
30
|
}
|
|
31
|
+
return call_cid;
|
|
32
|
+
} catch {
|
|
33
|
+
logger('debug', `Error in getting call cid from native module for callUUID: ${callUUID} - probably the call was already processed, so ignoring this callkeep event`);
|
|
31
34
|
}
|
|
32
|
-
return
|
|
35
|
+
return undefined;
|
|
33
36
|
}
|
|
34
37
|
function answerCall(callUUID) {
|
|
35
38
|
getCallCid(callUUID).then(call_cid => {
|
|
@@ -112,7 +115,7 @@ const iosCallkeepAcceptCall = (call_cid, callUUIDFromCallkeep) => {
|
|
|
112
115
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
113
116
|
return;
|
|
114
117
|
}
|
|
115
|
-
clearPushWSEventSubscriptions();
|
|
118
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
116
119
|
// to call end callkeep later if ended in app and not through callkeep
|
|
117
120
|
voipCallkeepAcceptedCallOnNativeDialerMap$.next({
|
|
118
121
|
uuid: callUUIDFromCallkeep,
|
|
@@ -127,11 +130,14 @@ const iosCallkeepRejectCall = async (call_cid, callUUIDFromCallkeep, pushConfig)
|
|
|
127
130
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
128
131
|
return;
|
|
129
132
|
}
|
|
130
|
-
clearPushWSEventSubscriptions();
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
134
|
+
// remove the references if the call_cid matches
|
|
135
|
+
const voipPushNotificationCallCId = RxUtils.getCurrentValue(voipPushNotificationCallCId$);
|
|
136
|
+
if (voipPushNotificationCallCId === call_cid) {
|
|
137
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
|
|
138
|
+
voipCallkeepCallOnForegroundMap$.next(undefined);
|
|
139
|
+
voipPushNotificationCallCId$.next(undefined);
|
|
140
|
+
}
|
|
135
141
|
await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
|
|
136
142
|
await NativeModules.StreamVideoReactNative?.removeIncomingCall(call_cid);
|
|
137
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pushAcceptedIncomingCallCId$","voipCallkeepAcceptedCallOnNativeDialerMap$","voipCallkeepCallOnForegroundMap$","voipPushNotificationCallCId$","getLogger","RxUtils","getCallKeepLib","getVoipPushNotificationLib","clearPushWSEventSubscriptions","processCallFromPushInBackground","AppState","NativeModules","Platform","setPushLogoutCallback","setupIosCallKeepEvents","pushConfig","OS","ios","pushProviderName","android","incomingCallChannel","logger","callkeep","getCallCid","callUUID","call_cid","
|
|
1
|
+
{"version":3,"names":["pushAcceptedIncomingCallCId$","voipCallkeepAcceptedCallOnNativeDialerMap$","voipCallkeepCallOnForegroundMap$","voipPushNotificationCallCId$","getLogger","RxUtils","getCallKeepLib","getVoipPushNotificationLib","clearPushWSEventSubscriptions","processCallFromPushInBackground","AppState","NativeModules","Platform","setPushLogoutCallback","setupIosCallKeepEvents","pushConfig","OS","ios","pushProviderName","android","incomingCallChannel","logger","callkeep","getCallCid","callUUID","call_cid","StreamVideoReactNative","getIncomingCallCid","voipPushNotificationCallCId","getCurrentValue","next","undefined","answerCall","then","iosCallkeepAcceptCall","endCall","iosCallkeepRejectCall","didDisplayIncomingCall","payload","voipPushNotification","currentState","uuid","cid","onVoipNotificationCompleted","remove","removeAnswerCall","addEventListener","removeEndCall","removeDisplayIncomingCall","removeDidLoadWithEvents","events","Array","isArray","length","forEach","event","name","data","callUUIDFromCallkeep","shouldProcessCallFromCallkeep","removeIncomingCall"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosCallKeepEvents.ts"],"mappings":"AAAA,SACEA,4BAA4B,EAC5BC,0CAA0C,EAC1CC,gCAAgC,EAChCC,4BAA4B,QACvB,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,OAAO,QAAQ,yBAAyB;AAC5D,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,QAAQ;AAEnE,SACEC,6BAA6B,EAC7BC,+BAA+B,QAC1B,kBAAkB;AACzB,SAASC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAChE,SAASC,qBAAqB,QAAQ,gCAAgC;AAItE;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,IAAIH,QAAQ,CAACI,EAAE,KAAK,KAAK,IAAI,CAACD,UAAU,CAACE,GAAG,CAACC,gBAAgB,EAAE;IAC7D;EACF;EACA,IAAI,CAACH,UAAU,CAACI,OAAO,CAACC,mBAAmB,EAAE;IAC3C;IACAhB,SAAS,CAAC,CAAC,wBAAwB,CAAC,CAAC,CACnC,OAAO,EACP,oFACF,CAAC;IACD;EACF;EACA,MAAMiB,MAAM,GA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Q,CAAC;EACvC;EACA,MAAMG,2BAA2B,GAAGvB,OAAO,CAACwB,eAAe,CACzD1B,4BACF,CAAC;EACD,IAAIyB,2BAA2B,KAAKH,QAAQ,EAAE;IAC5CxB,0CAA0C,CAAC6B,IAAI,CAACC,SAAS,CAAC;IAC1D7B,gCAAgC,CAAC4B,IAAI,CAACC,SAAS,CAAC;IAChD5B,4BAA4B,CAAC2B,IAAI,CAACC,SAAS,CAAC;EAC9C;EAEA,MAAMtB,+BAA+B,CAACM,UAAU,EAAEU,QAAQ,EAAE,SAAS,CAAC;EACtE,MAAMd,aAAa,CAACe,sBAAsB,EAAEkC,kBAAkB,CAACnC,QAAQ,CAAC;AAC1E,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMkC,6BAA6B,GAAGA,CACpClC,QAA4B,EAC5BiC,oBAA4B,KACL;EACvB,IAAI,CAACjC,QAAQ,IAAI,CAACiC,oBAAoB,EAAE;IACtC,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.21.
|
|
1
|
+
export const version = '1.21.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/StreamCall/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/StreamCall/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAY/C,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AACF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,qBAGxB,iBAAiB,CAAC,eAAe,CAAC,sBAWpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,sBAAsB,EAO3B,KAAK,UAAU,EAChB,MAAM,QAAQ,CAAC;AAsBhB,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,KAAK,+BAA+B,GAAG,UAAU,CAC/C,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAC3C,CAAC,CAAC,CAAC,CAAC;AAEL,KAAK,KAAK,GAAG,UAAU,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC;AAI5D,4BAA4B;AAC5B,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBAoE1D;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,sBAAsB,CAAC,aAAa,CAAC,MAAM,CAAC,kBA8QnD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,0BAGzC;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,kBA2GA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type UnsubscribeCallback = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* This map is used to store the unsubscribe callbacks (if any) of the push notification processing
|
|
4
|
+
* Note: it should be used to clear it when app processes push notification from foreground
|
|
5
|
+
*/
|
|
6
|
+
export declare const pushUnsubscriptionCallbacks: Map<string, UnsubscribeCallback[]>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/constants.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG,MAAM,IAAI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,2BAA2B,oCAGrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/ios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/ios.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,eAAO,MAAM,0BAA0B,GACrC,cAAc,GAAG,EACjB,YAAY,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,kBA6HnD,CAAC"}
|
|
@@ -40,11 +40,5 @@ type CallkeepMap = {
|
|
|
40
40
|
};
|
|
41
41
|
export declare const voipCallkeepCallOnForegroundMap$: BehaviorSubject<CallkeepMap | undefined>;
|
|
42
42
|
export declare const voipCallkeepAcceptedCallOnNativeDialerMap$: BehaviorSubject<CallkeepMap | undefined>;
|
|
43
|
-
type UnsubscribeCallback = () => void;
|
|
44
|
-
/**
|
|
45
|
-
* This rxjs subject is used to store the unsubscribe callbacks (if any) of the push notification processing
|
|
46
|
-
* Note: it should be used to clear it when app processes push notification from foreground
|
|
47
|
-
*/
|
|
48
|
-
export declare const pushUnsubscriptionCallbacks$: BehaviorSubject<UnsubscribeCallback[] | undefined>;
|
|
49
43
|
export {};
|
|
50
44
|
//# sourceMappingURL=rxSubjects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxSubjects.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/rxSubjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;SAC3B,MAAM;UAAQ,mBAAmB;cAC9B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qCAE3B,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,8CAA8C,qCACP,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb,sFAAsF;AACtF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAOF,eAAO,MAAM,gCAAgC,0CAEjC,CAAC;AAKb,eAAO,MAAM,0CAA0C,0CAE3C,CAAC
|
|
1
|
+
{"version":3,"file":"rxSubjects.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/rxSubjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;SAC3B,MAAM;UAAQ,mBAAmB;cAC9B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qCAE3B,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,8CAA8C,qCACP,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb,sFAAsF;AACtF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAOF,eAAO,MAAM,gCAAgC,0CAEjC,CAAC;AAKb,eAAO,MAAM,0CAA0C,0CAE3C,CAAC"}
|
|
@@ -33,7 +33,7 @@ export declare const processNonIncomingCallFromPush: (client: StreamVideoClient,
|
|
|
33
33
|
* This function is used to clear all the push related WS subscriptions
|
|
34
34
|
* note: events are subscribed in push for accept/decline through WS
|
|
35
35
|
*/
|
|
36
|
-
export declare const clearPushWSEventSubscriptions: () => void;
|
|
36
|
+
export declare const clearPushWSEventSubscriptions: (call_cid: string) => void;
|
|
37
37
|
/**
|
|
38
38
|
* This ref is used to check if the push WS subscriptions can be added
|
|
39
39
|
* It is used to avoid adding the push WS subscriptions when the client is connected to WS in the foreground
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAGJ,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAInC,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,IAAI,EAClB,eAAe,MAAM,GAAG,SAAS,EACjC,aAAa,MAAM,GAAG,SAAS;;;CAuChC,CAAC;AAMF,eAAO,MAAM,+BAA+B,GAC1C,YAAY,UAAU,EACtB,UAAU,MAAM,EAChB,QAAQ,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,kBAelD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,iBAAiB,EACzB,UAAU,MAAM,EAChB,QAAQ,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,qBAAqB,EAChE,YAAY,UAAU,kBAsCvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,QAAQ,iBAAiB,EACzB,UAAU,MAAM,EAChB,4BAA4B,mBAAmB,kBAmBhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,MAAM,SAM7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAE1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupIosCallKeepEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupIosCallKeepEvents.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAUhE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"setupIosCallKeepEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupIosCallKeepEvents.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAUhE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QA8HnD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.21.
|
|
1
|
+
export declare const version = "1.21.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-native-sdk",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Stream Video SDK for React Native",
|
|
5
5
|
"author": "https://getstream.io",
|
|
6
6
|
"homepage": "https://getstream.io/video/docs/react-native/",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"!**/.*"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@stream-io/video-client": "1.
|
|
49
|
-
"@stream-io/video-react-bindings": "1.
|
|
48
|
+
"@stream-io/video-client": "1.33.0",
|
|
49
|
+
"@stream-io/video-react-bindings": "1.9.0",
|
|
50
50
|
"intl-pluralrules": "2.0.1",
|
|
51
51
|
"lodash.merge": "^4.6.2",
|
|
52
52
|
"react-native-url-polyfill": "1.3.0",
|
|
@@ -2,13 +2,11 @@ import { StreamCallProvider } from '@stream-io/video-react-bindings';
|
|
|
2
2
|
import React, { type PropsWithChildren, useEffect } from 'react';
|
|
3
3
|
import { Call } from '@stream-io/video-client';
|
|
4
4
|
import { useIosCallkeepWithCallingStateEffect } from '../../hooks/push/useIosCallkeepWithCallingStateEffect';
|
|
5
|
-
import {
|
|
6
|
-
canAddPushWSSubscriptionsRef,
|
|
7
|
-
clearPushWSEventSubscriptions,
|
|
8
|
-
} from '../../utils/push/internal/utils';
|
|
5
|
+
import { canAddPushWSSubscriptionsRef } from '../../utils/push/internal/utils';
|
|
9
6
|
import { useAndroidKeepCallAliveEffect } from '../../hooks/useAndroidKeepCallAliveEffect';
|
|
10
7
|
import { AppStateListener } from './AppStateListener';
|
|
11
8
|
import { DeviceStats } from './DeviceStats';
|
|
9
|
+
import { pushUnsubscriptionCallbacks } from '../../utils/push/internal/constants';
|
|
12
10
|
|
|
13
11
|
// const PIP_CHANGE_EVENT = 'StreamVideoReactNative_PIP_CHANGE_EVENT';
|
|
14
12
|
|
|
@@ -68,7 +66,11 @@ const IosInformCallkeepCallEnd = () => {
|
|
|
68
66
|
*/
|
|
69
67
|
const ClearPushWSSubscriptions = () => {
|
|
70
68
|
useEffect(() => {
|
|
71
|
-
|
|
69
|
+
// clear all the push ws event subscriptions
|
|
70
|
+
pushUnsubscriptionCallbacks.forEach((cbArray) =>
|
|
71
|
+
cbArray.forEach((cb) => cb()),
|
|
72
|
+
);
|
|
73
|
+
pushUnsubscriptionCallbacks.clear();
|
|
72
74
|
canAddPushWSSubscriptionsRef.current = false;
|
|
73
75
|
return () => {
|
|
74
76
|
canAddPushWSSubscriptionsRef.current = true;
|
|
@@ -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 { AppState, Platform } from 'react-native';
|
|
@@ -26,8 +25,8 @@ import {
|
|
|
26
25
|
pushNonRingingCallData$,
|
|
27
26
|
pushRejectedIncomingCallCId$,
|
|
28
27
|
pushTappedIncomingCallCId$,
|
|
29
|
-
pushUnsubscriptionCallbacks$,
|
|
30
28
|
} from './internal/rxSubjects';
|
|
29
|
+
import { pushUnsubscriptionCallbacks } from './internal/constants';
|
|
31
30
|
import {
|
|
32
31
|
canAddPushWSSubscriptionsRef,
|
|
33
32
|
clearPushWSEventSubscriptions,
|
|
@@ -253,12 +252,8 @@ export const firebaseDataHandler = async (
|
|
|
253
252
|
);
|
|
254
253
|
unsubscribeFunctions.push(unsubscribe);
|
|
255
254
|
unsubscribeFunctions.push(() => subscription.unsubscribe());
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
pushUnsubscriptionCallbacks$.next([
|
|
259
|
-
...unsubscriptionCallbacks,
|
|
260
|
-
...unsubscribeFunctions,
|
|
261
|
-
]);
|
|
255
|
+
pushUnsubscriptionCallbacks.get(call_cid)?.forEach((cb) => cb());
|
|
256
|
+
pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
|
|
262
257
|
});
|
|
263
258
|
});
|
|
264
259
|
}
|
|
@@ -459,7 +454,7 @@ export const onAndroidNotifeeEvent = async ({
|
|
|
459
454
|
'debug',
|
|
460
455
|
`clearPushWSEventSubscriptions for callCId: ${call_cid} mustAccept: ${mustAccept} mustDecline: ${mustDecline}`,
|
|
461
456
|
);
|
|
462
|
-
clearPushWSEventSubscriptions();
|
|
457
|
+
clearPushWSEventSubscriptions(call_cid);
|
|
463
458
|
notifee.stopForegroundService();
|
|
464
459
|
}
|
|
465
460
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type UnsubscribeCallback = () => void;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This map is used to store the unsubscribe callbacks (if any) of the push notification processing
|
|
5
|
+
* Note: it should be used to clear it when app processes push notification from foreground
|
|
6
|
+
*/
|
|
7
|
+
export const pushUnsubscriptionCallbacks = new Map<
|
|
8
|
+
string,
|
|
9
|
+
UnsubscribeCallback[]
|
|
10
|
+
>();
|
|
@@ -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
|
|
|
@@ -124,12 +122,9 @@ export const onVoipNotificationReceived = async (
|
|
|
124
122
|
unsubscribe();
|
|
125
123
|
}
|
|
126
124
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
pushUnsubscriptionCallbacks
|
|
130
|
-
...unsubscriptionCallbacks,
|
|
131
|
-
unsubscribe,
|
|
132
|
-
]);
|
|
125
|
+
|
|
126
|
+
pushUnsubscriptionCallbacks.get(call_cid)?.forEach((cb) => cb());
|
|
127
|
+
pushUnsubscriptionCallbacks.set(call_cid, [unsubscribe]);
|
|
133
128
|
}
|
|
134
129
|
// send the info to this subject, it is listened by callkeep events
|
|
135
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
|
};
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.21.
|
|
1
|
+
export const version = '1.21.1';
|