@stream-io/video-react-native-sdk 0.1.3 → 0.1.5
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 +18 -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/CallControls/HangupCallButton.js +4 -6
- package/dist/commonjs/components/Call/CallControls/HangupCallButton.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +4 -0
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js +8 -2
- package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js +34 -0
- package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +50 -4
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +50 -0
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js +33 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/newNotificationCallbacks.js +18 -0
- package/dist/commonjs/utils/internal/newNotificationCallbacks.js.map +1 -0
- package/dist/commonjs/utils/internal/pushLogoutCallback.js +18 -0
- package/dist/commonjs/utils/internal/pushLogoutCallback.js.map +1 -0
- package/dist/commonjs/utils/push/android.js +182 -68
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js +107 -1
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs.js +34 -1
- package/dist/commonjs/utils/push/libs.js.map +1 -1
- package/dist/commonjs/utils/push/rxSubjects.js +8 -1
- package/dist/commonjs/utils/push/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/utils.js +29 -1
- package/dist/commonjs/utils/push/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +2 -2
- package/dist/module/components/Call/CallContent/CallContent.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/hooks/push/index.js +4 -0
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useInitAndroidTokenAndRest.js +8 -2
- package/dist/module/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
- package/dist/module/hooks/push/useIosInitRemoteNotifications.js +28 -0
- package/dist/module/hooks/push/useIosInitRemoteNotifications.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +49 -4
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +44 -0
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -0
- package/dist/module/utils/StreamVideoRN/index.js +32 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/newNotificationCallbacks.js +10 -0
- package/dist/module/utils/internal/newNotificationCallbacks.js.map +1 -0
- package/dist/module/utils/internal/pushLogoutCallback.js +10 -0
- package/dist/module/utils/internal/pushLogoutCallback.js.map +1 -0
- package/dist/module/utils/push/android.js +184 -70
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/ios.js +103 -1
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs.js +31 -1
- package/dist/module/utils/push/libs.js.map +1 -1
- package/dist/module/utils/push/rxSubjects.js +5 -0
- package/dist/module/utils/push/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/utils.js +27 -0
- package/dist/module/utils/push/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useInitAndroidTokenAndRest.d.ts +1 -1
- package/dist/typescript/hooks/push/useInitAndroidTokenAndRest.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts +5 -0
- package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts +7 -0
- package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts.map +1 -0
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +12 -0
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +40 -6
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts +10 -0
- package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts.map +1 -0
- package/dist/typescript/utils/internal/pushLogoutCallback.d.ts +8 -0
- package/dist/typescript/utils/internal/pushLogoutCallback.d.ts.map +1 -0
- package/dist/typescript/utils/push/android.d.ts +1 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +4 -0
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs.d.ts +6 -0
- package/dist/typescript/utils/push/libs.d.ts.map +1 -1
- package/dist/typescript/utils/push/rxSubjects.d.ts +9 -0
- package/dist/typescript/utils/push/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/utils.d.ts +9 -1
- package/dist/typescript/utils/push/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/index.d.ts +3 -2
- package/expo-config-plugin/dist/index.js +9 -5
- package/expo-config-plugin/dist/withPushAppDelegate.d.ts +4 -0
- package/expo-config-plugin/dist/withPushAppDelegate.js +119 -0
- package/expo-config-plugin/dist/withiOSInfoPlist.d.ts +2 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +6 -1
- package/package.json +19 -3
- package/src/components/Call/CallContent/CallContent.tsx +1 -1
- package/src/components/Call/CallControls/HangupCallButton.tsx +4 -4
- package/src/hooks/push/index.ts +4 -0
- package/src/hooks/push/useInitAndroidTokenAndRest.ts +8 -2
- package/src/hooks/push/useIosInitRemoteNotifications.ts +29 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +50 -3
- package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +44 -0
- package/src/utils/StreamVideoRN/index.ts +36 -0
- package/src/utils/StreamVideoRN/types.ts +47 -6
- package/src/utils/internal/newNotificationCallbacks.ts +29 -0
- package/src/utils/internal/pushLogoutCallback.ts +17 -0
- package/src/utils/push/android.ts +203 -74
- package/src/utils/push/ios.ts +120 -1
- package/src/utils/push/libs.ts +48 -2
- package/src/utils/push/rxSubjects.ts +9 -0
- package/src/utils/push/utils.ts +35 -1
- package/src/version.ts +1 -1
- /package/expo-config-plugin/dist/{withAppDelegate.d.ts → withStreamVideoReactNativeSDKAppDelegate.d.ts} +0 -0
- /package/expo-config-plugin/dist/{withAppDelegate.js → withStreamVideoReactNativeSDKAppDelegate.js} +0 -0
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.processCallFromPushInBackground = exports.processCallFromPush = void 0;
|
|
6
|
+
exports.processNonIncomingCallFromPush = exports.processCallFromPushInBackground = exports.processCallFromPush = void 0;
|
|
7
|
+
var _newNotificationCallbacks = require("../internal/newNotificationCallbacks");
|
|
7
8
|
/* An action for the notification or callkeep and app does not have JS context setup yet, so we need to do two steps:
|
|
8
9
|
1. we need to create a new client and connect the user to decline the call
|
|
9
10
|
2. this is because the app is in background state and we don't have a client to get the call and do an action
|
|
@@ -51,5 +52,32 @@ const processCallFromPush = async (client, call_cid, action) => {
|
|
|
51
52
|
console.log('failed to process call from push notification', e, action);
|
|
52
53
|
}
|
|
53
54
|
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* This function is used process the call from push notifications due to non ringing calls
|
|
58
|
+
* It does the following steps:
|
|
59
|
+
* 1. Get the call from the client if present or create a new call
|
|
60
|
+
* 2. Fetch the latest state of the call from the server if its not already in ringing state
|
|
61
|
+
* 3. Call all the callbacks to inform the app about the call
|
|
62
|
+
*/
|
|
54
63
|
exports.processCallFromPush = processCallFromPush;
|
|
64
|
+
const processNonIncomingCallFromPush = async (client, call_cid, nonRingingNotificationType) => {
|
|
65
|
+
let callFromPush;
|
|
66
|
+
try {
|
|
67
|
+
const _callFromPush = client.state.calls.find(c => c.cid === call_cid);
|
|
68
|
+
if (_callFromPush) {
|
|
69
|
+
callFromPush = _callFromPush;
|
|
70
|
+
} else {
|
|
71
|
+
// if not it means that WS is not alive when receiving the push notifications and we need to fetch the call
|
|
72
|
+
const [callType, callId] = call_cid.split(':');
|
|
73
|
+
callFromPush = client.call(callType, callId);
|
|
74
|
+
await callFromPush.get();
|
|
75
|
+
}
|
|
76
|
+
} catch (e) {
|
|
77
|
+
console.log('failed to fetch call from push notification', e);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
(0, _newNotificationCallbacks.onNewCallNotification)(callFromPush, nonRingingNotificationType);
|
|
81
|
+
};
|
|
82
|
+
exports.processNonIncomingCallFromPush = processNonIncomingCallFromPush;
|
|
55
83
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["processCallFromPushInBackground","pushConfig","call_cid","action","videoClient","createStreamVideoClient","e","console","log","processCallFromPush","exports","client","callFromPush","onRingingCall","join","leave","reject"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"names":["_newNotificationCallbacks","require","processCallFromPushInBackground","pushConfig","call_cid","action","videoClient","createStreamVideoClient","e","console","log","processCallFromPush","exports","client","callFromPush","onRingingCall","join","leave","reject","processNonIncomingCallFromPush","nonRingingNotificationType","_callFromPush","state","calls","find","c","cid","callType","callId","split","call","get","onNewCallNotification"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;;;;;AAKA,IAAAA,yBAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACO,MAAMC,+BAA+B,GAAG,MAAAA,CAC7CC,UAAsB,EACtBC,QAAgB,EAChBC,MAAiD,KAC9C;EACH,IAAIC,WAA0C;EAE9C,IAAI;IACFA,WAAW,GAAG,MAAMH,UAAU,CAACI,uBAAuB,CAAC,CAAC;IACxD,IAAI,CAACD,WAAW,EAAE;MAChB;IACF;EACF,CAAC,CAAC,OAAOE,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAAC,gDAAgD,EAAEF,CAAC,CAAC;IAChE;EACF;EACA,MAAMG,mBAAmB,CAACL,WAAW,EAAEF,QAAQ,EAAEC,MAAM,CAAC;AAC1D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAO,OAAA,CAAAV,+BAAA,GAAAA,+BAAA;AAOO,MAAMS,mBAAmB,GAAG,MAAAA,CACjCE,MAAyB,EACzBT,QAAgB,EAChBC,MAAwC,KACrC;EACH,IAAIS,YAAkB;EACtB,IAAI;IACFA,YAAY,GAAG,MAAMD,MAAM,CAACE,aAAa,CAACX,QAAQ,CAAC;EACrD,CAAC,CAAC,OAAOI,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAAC,6CAA6C,EAAEF,CAAC,CAAC;IAC7D;EACF;EACA;EACA,IAAI;IACF,IAAIH,MAAM,KAAK,QAAQ,EAAE;MACvB,MAAMS,YAAY,CAACE,IAAI,CAAC,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layout = 'grid',
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
landscape = false,
|
|
32
|
+
supportedReactions
|
|
33
33
|
} = _ref;
|
|
34
34
|
const [showRemoteParticipantInFloatingView, setShowRemoteParticipantInFloatingView] = useState(false);
|
|
35
35
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","StyleSheet","View","CallTopView","DefaultCallTopView","CallParticipantsGrid","CallParticipantsSpotlight","CallControls","DefaultCallControls","useCall","useCallStateHooks","CallingState","useIncallManager","Z_INDEX","useDebouncedValue","FloatingParticipantView","DefaultFloatingParticipantView","useTheme","CallContent","_ref","onBackPressed","onParticipantInfoPress","onHangupCallHandler","CallParticipantsList","ParticipantLabel","ParticipantNetworkQualityIndicator","ParticipantReaction","ParticipantVideoFallback","ParticipantView","ParticipantsInfoBadge","VideoRenderer","layout","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","StyleSheet","View","CallTopView","DefaultCallTopView","CallParticipantsGrid","CallParticipantsSpotlight","CallControls","DefaultCallControls","useCall","useCallStateHooks","CallingState","useIncallManager","Z_INDEX","useDebouncedValue","FloatingParticipantView","DefaultFloatingParticipantView","useTheme","CallContent","_ref","onBackPressed","onParticipantInfoPress","onHangupCallHandler","CallParticipantsList","ParticipantLabel","ParticipantNetworkQualityIndicator","ParticipantReaction","ParticipantVideoFallback","ParticipantView","ParticipantsInfoBadge","VideoRenderer","layout","landscape","supportedReactions","showRemoteParticipantInFloatingView","setShowRemoteParticipantInFloatingView","theme","callContent","useHasOngoingScreenShare","useRemoteParticipants","useLocalParticipant","_remoteParticipants","remoteParticipants","localParticipant","hasScreenShare","showSpotlightLayout","showFloatingView","length","isRemoteParticipantInFloatingView","media","auto","call","activeCallRef","current","handleFloatingViewParticipantSwitch","prevState","_activeCallRef$curren","state","callingState","LEFT","_activeCallRef$curren2","leave","participantViewProps","callParticipantsGridProps","showLocalParticipant","callParticipantsSpotlightProps","landScapeStyles","flexDirection","createElement","style","styles","container","callParticipantsContainer","view","topContainer","pointerEvents","_extends","participant","onPressHandler","create","flex","absoluteFillObject","zIndex","IN_FRONT"],"sourceRoot":"../../../../../src","sources":["components/Call/CallContent/CallContent.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAC1D,SACEC,WAAW,IAAIC,kBAAkB,QAE5B,gBAAgB;AACvB,SACEC,oBAAoB,EAEpBC,yBAAyB,QAEpB,eAAe;AACtB,SAEEC,YAAY,IAAIC,mBAAmB,QAE9B,iBAAiB;AACxB,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,YAAY,QAAwB,yBAAyB;AACtE,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SACEC,uBAAuB,IAAIC,8BAA8B,QAGpD,mBAAmB;AAC1B,SAASC,QAAQ,QAAQ,mBAAmB;AAsD5C,OAAO,MAAMC,WAAW,GAAGC,IAAA,IAkBH;EAAA,IAlBI;IAC1BC,aAAa;IACbC,sBAAsB;IACtBC,mBAAmB;IACnBC,oBAAoB;IACpBpB,WAAW,GAAGC,kBAAkB;IAChCG,YAAY,GAAGC,mBAAmB;IAClCO,uBAAuB,GAAGC,8BAA8B;IACxDQ,gBAAgB;IAChBC,kCAAkC;IAClCC,mBAAmB;IACnBC,wBAAwB;IACxBC,eAAe;IACfC,qBAAqB;IACrBC,aAAa;IACbC,MAAM,GAAG,MAAM;IACfC,SAAS,GAAG,KAAK;IACjBC;EACgB,CAAC,GAAAd,IAAA;EACjB,MAAM,CACJe,mCAAmC,EACnCC,sCAAsC,CACvC,GAAGnC,QAAQ,CAAU,KAAK,CAAC;EAC5B,MAAM;IACJoC,KAAK,EAAE;MAAEC;IAAY;EACvB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AC1ClB,KAAA,CAAAuE,aAAA,CAACrD,uBAAuB,EAAA6D,QAAA;IACtBC,WAAW,EACT7B,iCAAiC,GAC7BN,kBAAkB,CAAC,CAAC,CAAC,GACrBC,gBACL;IACDmC,cAAc,EAAExB,mCAAoC;IACpDrB,kBAAkB,EAAEA;EAAmB,GACnC6B,oBAAoB,CACzB,CAEC,CAAC,EACNjB,mBAAmB,gBAClBhD,KAAA,CAAAuE,aAAA,CAAC9D,yBAAyB,EAAK2D,8BAAiC,CAAC,gBAEjEpE,KAAA,CAAAuE,aAAA,CAAC/D,oBAAoB,EAAK0D,yBAA4B,CAEpD,CAAC,EAENxD,YAAY,iBACXV,KAAA,CAAAuE,aAAA,CAAC7D,YAAY;IACXe,mBAAmB,EAAEA,mBAAoB;IACzCU,SAAS,EAAEA;EAAU,CACtB,CAEC,CAAC;AAEX,CAAC;AAED,MAAMsC,MAAM,GAAGrE,UAAU,CAAC8E,MAAM,CAAC;EAC/BR,SAAS,EAAE;IAAES,IAAI,EAAE;EAAE,CAAC;EACtBP,IAAI,EAAE;IACJ,GAAGxE,UAAU,CAACgF,kBAAkB;IAChCC,MAAM,EAAErE,OAAO,CAACsE;EAClB;AACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CallControlsButton } from './CallControlsButton';
|
|
3
3
|
import { PhoneDown } from '../../../icons';
|
|
4
4
|
import { ButtonTestIds } from '../../../constants/TestIds';
|
|
@@ -31,7 +31,7 @@ export const HangUpCallButton = _ref => {
|
|
|
31
31
|
hangupCallButton
|
|
32
32
|
}
|
|
33
33
|
} = useTheme();
|
|
34
|
-
const onPress =
|
|
34
|
+
const onPress = async () => {
|
|
35
35
|
if (onPressHandler) {
|
|
36
36
|
onPressHandler();
|
|
37
37
|
return;
|
|
@@ -47,8 +47,7 @@ export const HangUpCallButton = _ref => {
|
|
|
47
47
|
} catch (error) {
|
|
48
48
|
console.error('Error leaving call:', error);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
}, [call]);
|
|
50
|
+
};
|
|
52
51
|
return /*#__PURE__*/React.createElement(CallControlsButton, {
|
|
53
52
|
onPress: onPress,
|
|
54
53
|
color: colors.error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","CallControlsButton","PhoneDown","ButtonTestIds","useCall","useCallStateHooks","CallingState","useTheme","HangUpCallButton","_ref","onPressHandler","onHangupCallHandler","call","useCallCallingState","callingState","theme","colors","hangupCallButton","onPress","LEFT","leave","error","console","createElement","color","style","testID","HANG_UP_CALL","static_white"],"sourceRoot":"../../../../../src","sources":["components/Call/CallControls/HangupCallButton.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,QAAQ,QAAQ,gCAAgC;;AAEzD;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAGH;EAAA,IAHI;IAC/BC,cAAc;IACdC;EACqB,CAAC,GAAAF,IAAA;EACtB,MAAMG,IAAI,GAAGR,OAAO,CAAC,CAAC;EACtB,MAAM;IAAES;EAAoB,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EACnD,MAAMS,YAAY,GAAGD,mBAAmB,CAAC,CAAC;EAC1C,MAAM;IACJE,KAAK,EAAE;MAAEC,MAAM;MAAEC;IAAiB;EACpC,CAAC,GAAGV,QAAQ,CAAC,CAAC;EAEd,MAAMW,OAAO,GAAG,MAAAA,CAAA,KAAY;IAC1B,IAAIR,cAAc,EAAE;MAClBA,cAAc,CAAC,CAAC;MAChB;IACF;IACA,IAAI;MACF,IAAII,YAAY,KAAKR,YAAY,CAACa,IAAI,EAAE;QACtC;MACF;MACA,OAAMP,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEQ,KAAK,CAAC,CAAC;MACnB,IAAIT,mBAAmB,EAAE;QACvBA,mBAAmB,CAAC,CAAC;MACvB;IACF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,qBAAqB,EAAEA,KAAK,CAAC;IAC7C;EACF,CAAC;EAED,oBACErB,KAAA,CAAAuB,aAAA,CAACtB,kBAAkB;IACjBiB,OAAO,EAAEA,OAAQ;IACjBM,KAAK,EAAER,MAAM,CAACK,KAAM;IACpBI,KAAK,EAAER,gBAAiB;IACxBS,MAAM,EAAEvB,aAAa,CAACwB;EAAa,gBAEnC3B,KAAA,CAAAuB,aAAA,CAACrB,SAAS;IAACsB,KAAK,EAAER,MAAM,CAACY;EAAa,CAAE,CACtB,CAAC;AAEzB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -2,14 +2,18 @@ import { useIosCallKeepEventsSetupEffect } from './useIosCallKeepEventsSetupEffe
|
|
|
2
2
|
import { useIosVoipPushEventsSetupEffect } from './useIosVoipPushEventsSetupEffect';
|
|
3
3
|
import { useProcessPushCallEffect } from './useProcessPushCallEffect';
|
|
4
4
|
import { useInitAndroidTokenAndRest } from './useInitAndroidTokenAndRest';
|
|
5
|
+
import { useIosInitRemoteNotifications } from './useIosInitRemoteNotifications';
|
|
6
|
+
import { useProcessPushNonRingingCallEffect } from './useProcessPushNonRingingCallEffect';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* This hook is used to do the initial setup for push notifications.
|
|
8
10
|
* It must be used in a component which is a child of StreamVideo from bindings
|
|
9
11
|
*/
|
|
10
12
|
export const usePushRegisterEffect = () => {
|
|
13
|
+
useIosInitRemoteNotifications();
|
|
11
14
|
useIosCallKeepEventsSetupEffect();
|
|
12
15
|
useIosVoipPushEventsSetupEffect();
|
|
16
|
+
useProcessPushNonRingingCallEffect();
|
|
13
17
|
useProcessPushCallEffect();
|
|
14
18
|
useInitAndroidTokenAndRest();
|
|
15
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useIosCallKeepEventsSetupEffect","useIosVoipPushEventsSetupEffect","useProcessPushCallEffect","useInitAndroidTokenAndRest","usePushRegisterEffect"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,0BAA0B,QAAQ,8BAA8B;;
|
|
1
|
+
{"version":3,"names":["useIosCallKeepEventsSetupEffect","useIosVoipPushEventsSetupEffect","useProcessPushCallEffect","useInitAndroidTokenAndRest","useIosInitRemoteNotifications","useProcessPushNonRingingCallEffect","usePushRegisterEffect"],"sourceRoot":"../../../../src","sources":["hooks/push/index.ts"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,kCAAkC,QAAQ,sCAAsC;;AAEzF;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACzCF,6BAA6B,CAAC,CAAC;EAC/BJ,+BAA+B,CAAC,CAAC;EACjCC,+BAA+B,CAAC,CAAC;EACjCI,kCAAkC,CAAC,CAAC;EACpCH,wBAAwB,CAAC,CAAC;EAC1BC,0BAA0B,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { StreamVideoRN } from '../../utils';
|
|
|
4
4
|
import { initAndroidPushToken } from '../../utils/push/android';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* This hook is used to initialize the push token for Android
|
|
7
|
+
* This hook is used to initialize the push token for Android.
|
|
8
8
|
*/
|
|
9
9
|
export const useInitAndroidTokenAndRest = () => {
|
|
10
10
|
var _useConnectedUser;
|
|
@@ -16,7 +16,13 @@ export const useInitAndroidTokenAndRest = () => {
|
|
|
16
16
|
if (!client || !connectedUserId || !pushConfig) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
let unsubscribe = () => {};
|
|
20
|
+
initAndroidPushToken(client, pushConfig, unsubscribeListener => {
|
|
21
|
+
unsubscribe = unsubscribeListener;
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
unsubscribe();
|
|
25
|
+
};
|
|
20
26
|
}, [client, connectedUserId]);
|
|
21
27
|
};
|
|
22
28
|
//# sourceMappingURL=useInitAndroidTokenAndRest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useConnectedUser","useStreamVideoClient","useEffect","StreamVideoRN","initAndroidPushToken","useInitAndroidTokenAndRest","_useConnectedUser","client","connectedUserId","id","pushConfig","getConfig","push"],"sourceRoot":"../../../../src","sources":["hooks/push/useInitAndroidTokenAndRest.ts"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,oBAAoB,QAAQ,0BAA0B;;AAE/D;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EAAA,IAAAC,iBAAA;EAC9C,MAAMC,MAAM,GAAGN,oBAAoB,CAAC,CAAC;EACrC,MAAMO,eAAe,IAAAF,iBAAA,GAAGN,gBAAgB,CAAC,CAAC,cAAAM,iBAAA,uBAAlBA,iBAAA,CAAoBG,EAAE;EAC9CP,SAAS,CAAC,MAAM;IACd,MAAMQ,UAAU,GAAGP,aAAa,CAACQ,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD;IACA,IAAI,CAACL,MAAM,IAAI,CAACC,eAAe,IAAI,CAACE,UAAU,EAAE;MAC9C;IACF;
|
|
1
|
+
{"version":3,"names":["useConnectedUser","useStreamVideoClient","useEffect","StreamVideoRN","initAndroidPushToken","useInitAndroidTokenAndRest","_useConnectedUser","client","connectedUserId","id","pushConfig","getConfig","push","unsubscribe","unsubscribeListener"],"sourceRoot":"../../../../src","sources":["hooks/push/useInitAndroidTokenAndRest.ts"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,oBAAoB,QAAQ,0BAA0B;;AAE/D;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EAAA,IAAAC,iBAAA;EAC9C,MAAMC,MAAM,GAAGN,oBAAoB,CAAC,CAAC;EACrC,MAAMO,eAAe,IAAAF,iBAAA,GAAGN,gBAAgB,CAAC,CAAC,cAAAM,iBAAA,uBAAlBA,iBAAA,CAAoBG,EAAE;EAC9CP,SAAS,CAAC,MAAM;IACd,MAAMQ,UAAU,GAAGP,aAAa,CAACQ,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD;IACA,IAAI,CAACL,MAAM,IAAI,CAACC,eAAe,IAAI,CAACE,UAAU,EAAE;MAC9C;IACF;IACA,IAAIG,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;IAC1BT,oBAAoB,CAACG,MAAM,EAAEG,UAAU,EAAGI,mBAAmB,IAAK;MAChED,WAAW,GAAGC,mBAAmB;IACnC,CAAC,CAAC;IACF,OAAO,MAAM;MACXD,WAAW,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,CAACN,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { StreamVideoRN } from '../../utils';
|
|
4
|
+
import { initIosNonVoipToken } from '../../utils/push/ios';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This hook is used to initialize the push token for iOS.
|
|
8
|
+
*/
|
|
9
|
+
export const useIosInitRemoteNotifications = () => {
|
|
10
|
+
var _useConnectedUser;
|
|
11
|
+
const client = useStreamVideoClient();
|
|
12
|
+
const connectedUserId = (_useConnectedUser = useConnectedUser()) === null || _useConnectedUser === void 0 ? void 0 : _useConnectedUser.id;
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const pushConfig = StreamVideoRN.getConfig().push;
|
|
15
|
+
// NOTE: we need to wait for user to be connected before we can send the push token
|
|
16
|
+
if (!client || !connectedUserId || !pushConfig) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let unsubscribe = () => {};
|
|
20
|
+
initIosNonVoipToken(client, pushConfig, unsubscribeListener => {
|
|
21
|
+
unsubscribe = unsubscribeListener;
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
unsubscribe();
|
|
25
|
+
};
|
|
26
|
+
}, [client, connectedUserId]);
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=useIosInitRemoteNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useConnectedUser","useStreamVideoClient","useEffect","StreamVideoRN","initIosNonVoipToken","useIosInitRemoteNotifications","_useConnectedUser","client","connectedUserId","id","pushConfig","getConfig","push","unsubscribe","unsubscribeListener"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosInitRemoteNotifications.ts"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,mBAAmB,QAAQ,sBAAsB;;AAE1D;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAAM;EAAA,IAAAC,iBAAA;EACjD,MAAMC,MAAM,GAAGN,oBAAoB,CAAC,CAAC;EACrC,MAAMO,eAAe,IAAAF,iBAAA,GAAGN,gBAAgB,CAAC,CAAC,cAAAM,iBAAA,uBAAlBA,iBAAA,CAAoBG,EAAE;EAC9CP,SAAS,CAAC,MAAM;IACd,MAAMQ,UAAU,GAAGP,aAAa,CAACQ,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD;IACA,IAAI,CAACL,MAAM,IAAI,CAACC,eAAe,IAAI,CAACE,UAAU,EAAE;MAC9C;IACF;IACA,IAAIG,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;IAC1BT,mBAAmB,CAACG,MAAM,EAAEG,UAAU,EAAGI,mBAAmB,IAAK;MAC/DD,WAAW,GAAGC,mBAAmB;IACnC,CAAC,CAAC;IACF,OAAO,MAAM;MACXD,WAAW,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,CAACN,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { Platform } from 'react-native';
|
|
|
4
4
|
import { StreamVideoRN } from '../../utils';
|
|
5
5
|
import { useStreamVideoClient } from '@stream-io/video-react-bindings';
|
|
6
6
|
import { voipPushNotificationCallCId$ } from '../../utils/push/rxSubjects';
|
|
7
|
+
import { setPushLogoutCallback } from '../../utils/internal/pushLogoutCallback';
|
|
8
|
+
let lastVoipToken = '';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* This hook is used to do the initial setup of listeners
|
|
@@ -16,13 +18,33 @@ export const useIosVoipPushEventsSetupEffect = () => {
|
|
|
16
18
|
if (Platform.OS !== 'ios' || !pushConfig || !client) {
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
21
|
+
if (lastVoipToken) {
|
|
22
|
+
// send token to stream (userId might have switched on the same device)
|
|
23
|
+
const push_provider_name = pushConfig.ios.pushProviderName;
|
|
24
|
+
if (!push_provider_name) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
client.addVoipDevice(lastVoipToken, 'apn', push_provider_name).catch(err => {
|
|
28
|
+
console.warn('Failed to send voip token to stream', err);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
19
31
|
const voipPushNotification = getVoipPushNotificationLib();
|
|
20
32
|
const onTokenReceived = token => {
|
|
21
33
|
// send token to stream
|
|
34
|
+
lastVoipToken = token;
|
|
22
35
|
const push_provider_name = pushConfig.ios.pushProviderName;
|
|
36
|
+
if (!push_provider_name) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
23
39
|
client.addVoipDevice(token, 'apn', push_provider_name).catch(err => {
|
|
24
40
|
console.warn('Failed to send voip token to stream', err);
|
|
25
41
|
});
|
|
42
|
+
// set the logout callback
|
|
43
|
+
setPushLogoutCallback(() => {
|
|
44
|
+
client.removeDevice(token).catch(err => {
|
|
45
|
+
console.warn('Failed to remove voip token from stream', err);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
26
48
|
};
|
|
27
49
|
// fired when PushKit give us the latest token
|
|
28
50
|
voipPushNotification.addEventListener('register', token => {
|
|
@@ -67,13 +89,36 @@ export const useIosVoipPushEventsSetupEffect = () => {
|
|
|
67
89
|
}, []);
|
|
68
90
|
};
|
|
69
91
|
const onNotificationReceived = notification => {
|
|
70
|
-
var _notification$stream, _notification$stream2;
|
|
92
|
+
var _notification$stream, _notification$stream2, _notification$stream3;
|
|
93
|
+
/* --- Example payload ---
|
|
94
|
+
{
|
|
95
|
+
"aps": {
|
|
96
|
+
"alert": {
|
|
97
|
+
"body": "",
|
|
98
|
+
"title": "Vishal Narkhede is calling you"
|
|
99
|
+
},
|
|
100
|
+
"badge": 0,
|
|
101
|
+
"category": "stream.video",
|
|
102
|
+
"mutable-content": 1
|
|
103
|
+
},
|
|
104
|
+
"stream": {
|
|
105
|
+
"call_cid": "default:ixbm7y0k74pbjnq",
|
|
106
|
+
"call_display_name": "",
|
|
107
|
+
"created_by_display_name": "Vishal Narkhede",
|
|
108
|
+
"created_by_id": "vishalexpo",
|
|
109
|
+
"receiver_id": "santhoshexpo",
|
|
110
|
+
"sender": "stream.video",
|
|
111
|
+
"type": "call.ring",
|
|
112
|
+
"version": "v2"
|
|
113
|
+
}
|
|
114
|
+
} */
|
|
71
115
|
const sender = notification === null || notification === void 0 || (_notification$stream = notification.stream) === null || _notification$stream === void 0 ? void 0 : _notification$stream.sender;
|
|
72
|
-
|
|
73
|
-
|
|
116
|
+
const type = notification === null || notification === void 0 || (_notification$stream2 = notification.stream) === null || _notification$stream2 === void 0 ? void 0 : _notification$stream2.type;
|
|
117
|
+
// do not process any other notifications other than stream.video or ringing
|
|
118
|
+
if (sender !== 'stream.video' && type !== 'call.ring') {
|
|
74
119
|
return;
|
|
75
120
|
}
|
|
76
|
-
const call_cid = notification === null || notification === void 0 || (_notification$
|
|
121
|
+
const call_cid = notification === null || notification === void 0 || (_notification$stream3 = notification.stream) === null || _notification$stream3 === void 0 ? void 0 : _notification$stream3.call_cid;
|
|
77
122
|
if (call_cid) {
|
|
78
123
|
// send the info to this subject, it is listened by callkeep events
|
|
79
124
|
// callkeep events will then accept/reject the call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","getVoipPushNotificationLib","Platform","StreamVideoRN","useStreamVideoClient","voipPushNotificationCallCId$","useIosVoipPushEventsSetupEffect","client","pushConfig","getConfig","push","OS","
|
|
1
|
+
{"version":3,"names":["useEffect","getVoipPushNotificationLib","Platform","StreamVideoRN","useStreamVideoClient","voipPushNotificationCallCId$","setPushLogoutCallback","lastVoipToken","useIosVoipPushEventsSetupEffect","client","pushConfig","getConfig","push","OS","push_provider_name","ios","pushProviderName","addVoipDevice","catch","err","console","warn","voipPushNotification","onTokenReceived","token","removeDevice","addEventListener","events","Array","isArray","length","voipPushEvent","name","data","onNotificationReceived","removeEventListener","notification","_notification$stream","_notification$stream2","_notification$stream3","sender","stream","type","call_cid","next"],"sourceRoot":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from 'react';
|
|
3
|
+
import { StreamVideoRN } from '../../utils';
|
|
4
|
+
import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
|
|
5
|
+
import { filter } from 'rxjs/operators';
|
|
6
|
+
import { processNonIncomingCallFromPush } from '../../utils/push/utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
|
|
10
|
+
* Note: this effect cannot work when push notifications are received when the app is in quit state or in other words when the client is not connected with a websocket.
|
|
11
|
+
* So we essentially run this effect only when the client is connected with a websocket.
|
|
12
|
+
*/
|
|
13
|
+
export const useProcessPushNonRingingCallEffect = () => {
|
|
14
|
+
var _useConnectedUser;
|
|
15
|
+
const client = useStreamVideoClient();
|
|
16
|
+
const connectedUserId = (_useConnectedUser = useConnectedUser()) === null || _useConnectedUser === void 0 ? void 0 : _useConnectedUser.id;
|
|
17
|
+
// The Effect to join/reject call automatically when incoming call was received and processed from push notification
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const pushConfig = StreamVideoRN.getConfig().push;
|
|
20
|
+
if (!pushConfig || !client || !connectedUserId) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const subscription = pushNonRingingCallData$.pipe(filter(NotUndefined)).subscribe(async _ref => {
|
|
24
|
+
let {
|
|
25
|
+
cid,
|
|
26
|
+
type
|
|
27
|
+
} = _ref;
|
|
28
|
+
await processNonIncomingCallFromPush(client, cid, type);
|
|
29
|
+
pushNonRingingCallData$.next(undefined); // remove the current data to avoid processing again
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
subscription.unsubscribe();
|
|
34
|
+
};
|
|
35
|
+
}, [client, connectedUserId]);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A type guard to check if the data is not undefined
|
|
40
|
+
*/
|
|
41
|
+
function NotUndefined(data) {
|
|
42
|
+
return data !== undefined;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=useProcessPushNonRingingCallEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pushNonRingingCallData$","useEffect","StreamVideoRN","useConnectedUser","useStreamVideoClient","filter","processNonIncomingCallFromPush","useProcessPushNonRingingCallEffect","_useConnectedUser","client","connectedUserId","id","pushConfig","getConfig","push","subscription","pipe","NotUndefined","subscribe","_ref","cid","type","next","undefined","unsubscribe","data"],"sourceRoot":"../../../../src","sources":["hooks/push/useProcessPushNonRingingCallEffect.ts"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SACEC,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,8BAA8B,QAAQ,wBAAwB;;AAEvE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;EAAA,IAAAC,iBAAA;EACtD,MAAMC,MAAM,GAAGL,oBAAoB,CAAC,CAAC;EACrC,MAAMM,eAAe,IAAAF,iBAAA,GAAGL,gBAAgB,CAAC,CAAC,cAAAK,iBAAA,uBAAlBA,iBAAA,CAAoBG,EAAE;EAC9C;EACAV,SAAS,CAAC,MAAM;IACd,MAAMW,UAAU,GAAGV,aAAa,CAACW,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD,IAAI,CAACF,UAAU,IAAI,CAACH,MAAM,IAAI,CAACC,eAAe,EAAE;MAC9C;IACF;IAEA,MAAMK,YAAY,GAAGf,uBAAuB,CACzCgB,IAAI,CAACX,MAAM,CAACY,YAAY,CAAC,CAAC,CAC1BC,SAAS,CAAC,MAAAC,IAAA,IAAyB;MAAA,IAAlB;QAAEC,GAAG;QAAEC;MAAK,CAAC,GAAAF,IAAA;MAC7B,MAAMb,8BAA8B,CAACG,MAAM,EAAEW,GAAG,EAAEC,IAAI,CAAC;MACvDrB,uBAAuB,CAACsB,IAAI,CAACC,SAAS,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;;IAEJ,OAAO,MAAM;MACXR,YAAY,CAACS,WAAW,CAAC,CAAC;IAC5B,CAAC;EACH,CAAC,EAAE,CAACf,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA,SAASO,YAAYA,CAAIQ,IAAmB,EAAa;EACvD,OAAOA,IAAI,KAAKF,SAAS;AAC3B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { AndroidImportance } from '@notifee/react-native';
|
|
2
2
|
import { setupFirebaseHandlerAndroid } from '../push/android';
|
|
3
|
+
import pushLogoutCallbacks from '../internal/pushLogoutCallback';
|
|
4
|
+
import { setupRemoteNotificationsHandleriOS } from '../push/ios';
|
|
5
|
+
import newNotificationCallbacks from '../internal/newNotificationCallbacks';
|
|
3
6
|
const DEFAULT_STREAM_VIDEO_CONFIG = {
|
|
4
7
|
foregroundService: {
|
|
5
8
|
android: {
|
|
@@ -55,9 +58,38 @@ export class StreamVideoRN {
|
|
|
55
58
|
this.config.push = pushConfig;
|
|
56
59
|
// After getting the config we should setup callkeep events, firebase handler asap to handle incoming calls from a dead state
|
|
57
60
|
setupFirebaseHandlerAndroid(pushConfig);
|
|
61
|
+
// setup ios handler for non-voip push notifications asap
|
|
62
|
+
setupRemoteNotificationsHandleriOS(pushConfig);
|
|
58
63
|
}
|
|
59
64
|
static getConfig() {
|
|
60
65
|
return this.config;
|
|
61
66
|
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* This is the function to be called when the push token must be removed.
|
|
70
|
+
* Typically used on user logout.
|
|
71
|
+
*/
|
|
72
|
+
static onPushLogout() {
|
|
73
|
+
if (pushLogoutCallbacks.current) {
|
|
74
|
+
pushLogoutCallbacks.current.forEach(callback => callback());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* This function is used to add a callback to be called when a new call notification is received.
|
|
80
|
+
* @param callback
|
|
81
|
+
* @returns Unsubscribe function
|
|
82
|
+
*/
|
|
83
|
+
static addOnNewCallNotificationListener(callback) {
|
|
84
|
+
if (!newNotificationCallbacks.current) {
|
|
85
|
+
newNotificationCallbacks.current = [callback];
|
|
86
|
+
} else {
|
|
87
|
+
newNotificationCallbacks.current.push(callback);
|
|
88
|
+
}
|
|
89
|
+
return () => {
|
|
90
|
+
var _newNotificationCallb;
|
|
91
|
+
newNotificationCallbacks.current = (_newNotificationCallb = newNotificationCallbacks.current) === null || _newNotificationCallb === void 0 ? void 0 : _newNotificationCallb.filter(cb => cb !== callback);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
62
94
|
}
|
|
63
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AndroidImportance","setupFirebaseHandlerAndroid","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","lights","vibration","importance","DEFAULT","notificationTexts","title","body","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","getConfig"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,2BAA2B,QAAQ,iBAAiB;
|
|
1
|
+
{"version":3,"names":["AndroidImportance","setupFirebaseHandlerAndroid","pushLogoutCallbacks","setupRemoteNotificationsHandleriOS","newNotificationCallbacks","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","lights","vibration","importance","DEFAULT","notificationTexts","title","body","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","getConfig","onPushLogout","current","forEach","callback","addOnNewCallNotificationListener","_newNotificationCallb","filter","cb"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,2BAA2B,QAAQ,iBAAiB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D;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,gCAAgCA,CACrCD,QAAqC,EACrC;IACA,IAAI,CAACxB,wBAAwB,CAACsB,OAAO,EAAE;MACrCtB,wBAAwB,CAACsB,OAAO,GAAG,CAACE,QAAQ,CAAC;IAC/C,CAAC,MAAM;MACLxB,wBAAwB,CAACsB,OAAO,CAACH,IAAI,CAACK,QAAQ,CAAC;IACjD;IACA,OAAO,MAAM;MAAA,IAAAE,qBAAA;MACX1B,wBAAwB,CAACsB,OAAO,IAAAI,qBAAA,GAC9B1B,wBAAwB,CAACsB,OAAO,cAAAI,qBAAA,uBAAhCA,qBAAA,CAAkCC,MAAM,CAAEC,EAAE,IAAKA,EAAE,KAAKJ,QAAQ,CAAC;IACrE,CAAC;EACH;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
let lastCid = '';
|
|
2
|
+
const newNotificationCallbacks = {};
|
|
3
|
+
export const onNewCallNotification = (call, notificationType) => {
|
|
4
|
+
if (newNotificationCallbacks.current && lastCid !== call.cid) {
|
|
5
|
+
newNotificationCallbacks.current.forEach(callback => callback(call, notificationType));
|
|
6
|
+
lastCid = call.cid;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export default newNotificationCallbacks;
|
|
10
|
+
//# sourceMappingURL=newNotificationCallbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lastCid","newNotificationCallbacks","onNewCallNotification","call","notificationType","current","cid","forEach","callback"],"sourceRoot":"../../../../src","sources":["utils/internal/newNotificationCallbacks.ts"],"mappings":"AAYA,IAAIA,OAAO,GAAG,EAAE;AAEhB,MAAMC,wBAAkD,GAAG,CAAC,CAAC;AAE7D,OAAO,MAAMC,qBAAkD,GAAGA,CAChEC,IAAI,EACJC,gBAAgB,KACb;EACH,IAAIH,wBAAwB,CAACI,OAAO,IAAIL,OAAO,KAAKG,IAAI,CAACG,GAAG,EAAE;IAC5DL,wBAAwB,CAACI,OAAO,CAACE,OAAO,CAAEC,QAAQ,IAChDA,QAAQ,CAACL,IAAI,EAAEC,gBAAgB,CACjC,CAAC;IACDJ,OAAO,GAAGG,IAAI,CAACG,GAAG;EACpB;AACF,CAAC;AAED,eAAeL,wBAAwB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
let pushLogoutCallbacks = {};
|
|
2
|
+
export const setPushLogoutCallback = callback => {
|
|
3
|
+
if (!pushLogoutCallbacks.current) {
|
|
4
|
+
pushLogoutCallbacks.current = [callback];
|
|
5
|
+
} else {
|
|
6
|
+
pushLogoutCallbacks.current.push(callback);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export default pushLogoutCallbacks;
|
|
10
|
+
//# sourceMappingURL=pushLogoutCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pushLogoutCallbacks","setPushLogoutCallback","callback","current","push"],"sourceRoot":"../../../../src","sources":["utils/internal/pushLogoutCallback.ts"],"mappings":"AAMA,IAAIA,mBAAwC,GAAG,CAAC,CAAC;AAEjD,OAAO,MAAMC,qBAAqB,GAAIC,QAAoB,IAAK;EAC7D,IAAI,CAACF,mBAAmB,CAACG,OAAO,EAAE;IAChCH,mBAAmB,CAACG,OAAO,GAAG,CAACD,QAAQ,CAAC;EAC1C,CAAC,MAAM;IACLF,mBAAmB,CAACG,OAAO,CAACC,IAAI,CAACF,QAAQ,CAAC;EAC5C;AACF,CAAC;AAED,eAAeF,mBAAmB"}
|