@stream-io/video-react-native-sdk 1.35.0 → 1.36.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 +29 -0
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +9 -2
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +9 -2
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +11 -12
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/TextBasedIndicator.js +7 -2
- package/dist/commonjs/components/Call/RingingCallContent/TextBasedIndicator.js.map +1 -1
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +7 -3
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +0 -4
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +6 -0
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +0 -17
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +55 -32
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +2 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +0 -93
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/index.js +0 -11
- package/dist/commonjs/utils/push/index.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +2 -31
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callingx.js +9 -0
- package/dist/commonjs/utils/push/libs/callingx.js.map +1 -1
- package/dist/commonjs/utils/push/libs/index.js +0 -33
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/utils.js +0 -28
- package/dist/commonjs/utils/push/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js +9 -2
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +9 -2
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +11 -12
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/TextBasedIndicator.js +7 -2
- package/dist/module/components/Call/RingingCallContent/TextBasedIndicator.js.map +1 -1
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +7 -3
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
- package/dist/module/hooks/push/index.js +0 -4
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +6 -0
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +0 -17
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +56 -33
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/internal/registerSDKGlobals.js +2 -0
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +1 -92
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/index.js +0 -1
- package/dist/module/utils/push/index.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +0 -28
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/libs/callingx.js +9 -0
- package/dist/module/utils/push/libs/callingx.js.map +1 -1
- package/dist/module/utils/push/libs/index.js +0 -3
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/utils.js +0 -25
- package/dist/module/utils/push/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/TextBasedIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +0 -7
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +19 -40
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +1 -6
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/index.d.ts +0 -1
- package/dist/typescript/utils/push/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +2 -10
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +16 -2
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/index.d.ts +0 -3
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/utils.d.ts +0 -6
- package/dist/typescript/utils/push/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/withAppDelegate.js +56 -0
- package/ios/StreamVideoReactNative.h +14 -0
- package/ios/StreamVideoReactNative.m +129 -7
- package/package.json +7 -17
- package/src/components/Call/RingingCallContent/IncomingCall.tsx +14 -2
- package/src/components/Call/RingingCallContent/OutgoingCall.tsx +14 -2
- package/src/components/Call/RingingCallContent/RingingCallContent.tsx +7 -12
- package/src/components/Call/RingingCallContent/TextBasedIndicator.tsx +13 -2
- package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +10 -2
- package/src/hooks/push/index.ts +0 -4
- package/src/modules/call-manager/CallManager.ts +6 -0
- package/src/utils/StreamVideoRN/index.ts +0 -22
- package/src/utils/StreamVideoRN/types.ts +19 -46
- package/src/utils/internal/callingx/callingx.ts +60 -29
- package/src/utils/internal/registerSDKGlobals.ts +2 -0
- package/src/utils/push/android.ts +1 -117
- package/src/utils/push/index.ts +0 -1
- package/src/utils/push/internal/utils.ts +1 -41
- package/src/utils/push/libs/callingx.ts +12 -0
- package/src/utils/push/libs/index.ts +0 -3
- package/src/utils/push/utils.ts +0 -37
- package/src/version.ts +1 -1
- package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js +0 -33
- package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js.map +0 -1
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +0 -49
- package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js.map +0 -1
- package/dist/commonjs/utils/internal/newNotificationCallbacks.js +0 -17
- package/dist/commonjs/utils/internal/newNotificationCallbacks.js.map +0 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +0 -13
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +0 -1
- package/dist/commonjs/utils/push/ios.js +0 -158
- package/dist/commonjs/utils/push/ios.js.map +0 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js +0 -25
- package/dist/commonjs/utils/push/libs/expoNotifications.js.map +0 -1
- package/dist/commonjs/utils/push/libs/iosPushNotification.js +0 -17
- package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +0 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +0 -38
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +0 -1
- package/dist/commonjs/utils/push/libs/notifee/lib.js +0 -16
- package/dist/commonjs/utils/push/libs/notifee/lib.js.map +0 -1
- package/dist/module/hooks/push/useIosInitRemoteNotifications.js +0 -27
- package/dist/module/hooks/push/useIosInitRemoteNotifications.js.map +0 -1
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +0 -43
- package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +0 -1
- package/dist/module/utils/internal/newNotificationCallbacks.js +0 -10
- package/dist/module/utils/internal/newNotificationCallbacks.js.map +0 -1
- package/dist/module/utils/push/internal/rxSubjects.js +0 -7
- package/dist/module/utils/push/internal/rxSubjects.js.map +0 -1
- package/dist/module/utils/push/ios.js +0 -148
- package/dist/module/utils/push/ios.js.map +0 -1
- package/dist/module/utils/push/libs/expoNotifications.js +0 -18
- package/dist/module/utils/push/libs/expoNotifications.js.map +0 -1
- package/dist/module/utils/push/libs/iosPushNotification.js +0 -11
- package/dist/module/utils/push/libs/iosPushNotification.js.map +0 -1
- package/dist/module/utils/push/libs/notifee/index.js +0 -31
- package/dist/module/utils/push/libs/notifee/index.js.map +0 -1
- package/dist/module/utils/push/libs/notifee/lib.js +0 -11
- package/dist/module/utils/push/libs/notifee/lib.js.map +0 -1
- package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts +0 -5
- package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts.map +0 -1
- package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts +0 -7
- package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts.map +0 -1
- package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts +0 -10
- package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts.map +0 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +0 -11
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +0 -1
- package/dist/typescript/utils/push/ios.d.ts +0 -14
- package/dist/typescript/utils/push/ios.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts +0 -6
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +0 -5
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -23
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/notifee/lib.d.ts +0 -4
- package/dist/typescript/utils/push/libs/notifee/lib.d.ts.map +0 -1
- package/src/hooks/push/useIosInitRemoteNotifications.ts +0 -29
- package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +0 -50
- package/src/utils/internal/newNotificationCallbacks.ts +0 -29
- package/src/utils/push/internal/rxSubjects.ts +0 -10
- package/src/utils/push/ios.ts +0 -207
- package/src/utils/push/libs/expoNotifications.ts +0 -32
- package/src/utils/push/libs/iosPushNotification.ts +0 -22
- package/src/utils/push/libs/notifee/index.ts +0 -41
- package/src/utils/push/libs/notifee/lib.ts +0 -14
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { lib } from './lib';
|
|
2
|
-
var AndroidForegroundServiceType = /*#__PURE__*/function (AndroidForegroundServiceType) {
|
|
3
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CAMERA"] = 64] = "FOREGROUND_SERVICE_TYPE_CAMERA";
|
|
4
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE"] = 16] = "FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE";
|
|
5
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_DATA_SYNC"] = 1] = "FOREGROUND_SERVICE_TYPE_DATA_SYNC";
|
|
6
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_HEALTH"] = 256] = "FOREGROUND_SERVICE_TYPE_HEALTH";
|
|
7
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_LOCATION"] = 8] = "FOREGROUND_SERVICE_TYPE_LOCATION";
|
|
8
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK"] = 2] = "FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK";
|
|
9
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION"] = 32] = "FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION";
|
|
10
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING"] = 8192] = "FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING";
|
|
11
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MICROPHONE"] = 128] = "FOREGROUND_SERVICE_TYPE_MICROPHONE";
|
|
12
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_PHONE_CALL"] = 4] = "FOREGROUND_SERVICE_TYPE_PHONE_CALL";
|
|
13
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING"] = 512] = "FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING";
|
|
14
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"] = 2048] = "FOREGROUND_SERVICE_TYPE_SHORT_SERVICE";
|
|
15
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SPECIAL_USE"] = 1073741824] = "FOREGROUND_SERVICE_TYPE_SPECIAL_USE";
|
|
16
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED"] = 1024] = "FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED";
|
|
17
|
-
AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MANIFEST"] = -1] = "FOREGROUND_SERVICE_TYPE_MANIFEST";
|
|
18
|
-
return AndroidForegroundServiceType;
|
|
19
|
-
}(AndroidForegroundServiceType || {});
|
|
20
|
-
const INSTALLATION_INSTRUCTION = 'Please see https://notifee.app/react-native/docs/installation for installation instructions';
|
|
21
|
-
export function getNotifeeLibThrowIfNotInstalledForPush() {
|
|
22
|
-
if (!lib) {
|
|
23
|
-
throw Error('@notifee/react-native is not installed. It is required for implementing push notifications. ' + INSTALLATION_INSTRUCTION);
|
|
24
|
-
}
|
|
25
|
-
return lib;
|
|
26
|
-
}
|
|
27
|
-
export function getIncomingCallForegroundServiceTypes() {
|
|
28
|
-
const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE];
|
|
29
|
-
return types;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["lib","AndroidForegroundServiceType","INSTALLATION_INSTRUCTION","getNotifeeLibThrowIfNotInstalledForPush","Error","getIncomingCallForegroundServiceTypes","types","FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/index.ts"],"mappings":"AAAA,SAASA,GAAG,QAAmB,OAAO;AAAC,IAIlCC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA,EAA5BA,4BAA4B;AAkBjC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAE/F,OAAO,SAASC,uCAAuCA,CAAA,EAAG;EACxD,IAAI,CAACH,GAAG,EAAE;IACR,MAAMI,KAAK,CACT,8FAA8F,GAC5FF,wBACJ,CAAC;EACH;EACA,OAAOF,GAAG;AACZ;AAEA,OAAO,SAASK,qCAAqCA,CAAA,EAAG;EACtD,MAAMC,KAAqC,GAAG,CAC5CL,4BAA4B,CAACM,qCAAqC,CACnE;EACD,OAAOD,KAAK;AACd","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
let lib;
|
|
2
|
-
try {
|
|
3
|
-
lib = require('@notifee/react-native');
|
|
4
|
-
} catch {}
|
|
5
|
-
export { lib };
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
IMPORTANT: must keep a failing import in a different file
|
|
9
|
-
Else on commonjs, metro doesnt resolve any other modules properly in a file, if one of the module is not installed
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=lib.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["lib","require"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/lib.ts"],"mappings":"AAEA,IAAIA,GAAqB;AAEzB,IAAI;EACFA,GAAG,GAAGC,OAAO,CAAC,uBAAuB,CAAC;AACxC,CAAC,CAAC,MAAM,CAAC;AAET,SAASD,GAAG;;AAEZ;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIosInitRemoteNotifications.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useIosInitRemoteNotifications.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,6BAA6B,YAiBzC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
|
|
3
|
-
* 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.
|
|
4
|
-
* So we essentially run this effect only when the client is connected with a websocket.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useProcessPushNonRingingCallEffect: () => void;
|
|
7
|
-
//# sourceMappingURL=useProcessPushNonRingingCallEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useProcessPushNonRingingCallEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useProcessPushNonRingingCallEffect.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,YA0B9C,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Call } from '@stream-io/video-client';
|
|
2
|
-
import { type NonRingingPushEvent } from '../StreamVideoRN/types';
|
|
3
|
-
export type NewCallNotificationCallback = (call: Call, notificationType: NonRingingPushEvent) => void;
|
|
4
|
-
type NewNotificationCallbacks = {
|
|
5
|
-
current?: NewCallNotificationCallback[];
|
|
6
|
-
};
|
|
7
|
-
declare const newNotificationCallbacks: NewNotificationCallbacks;
|
|
8
|
-
export declare const onNewCallNotification: NewCallNotificationCallback;
|
|
9
|
-
export default newNotificationCallbacks;
|
|
10
|
-
//# sourceMappingURL=newNotificationCallbacks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"newNotificationCallbacks.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/newNotificationCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,MAAM,2BAA2B,GAAG,CACxC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,mBAAmB,KAClC,IAAI,CAAC;AAEV,KAAK,wBAAwB,GAAG;IAC9B,OAAO,CAAC,EAAE,2BAA2B,EAAE,CAAC;CACzC,CAAC;AAIF,QAAA,MAAM,wBAAwB,EAAE,wBAA6B,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,2BAUnC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import type { NonRingingPushEvent } from '../../StreamVideoRN/types';
|
|
3
|
-
/**
|
|
4
|
-
* This rxjs subject is used to store the call cid of the accepted incoming call from push notification
|
|
5
|
-
* Note: it is should be subscribed only when a user has connected to the websocket of Stream
|
|
6
|
-
*/
|
|
7
|
-
export declare const pushNonRingingCallData$: BehaviorSubject<{
|
|
8
|
-
cid: string;
|
|
9
|
-
type: NonRingingPushEvent;
|
|
10
|
-
} | undefined>;
|
|
11
|
-
//# sourceMappingURL=rxSubjects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
2
|
-
import { type ExpoNotification, type PushNotificationiOSType } from './libs';
|
|
3
|
-
import { StreamVideoClient } from '@stream-io/video-client';
|
|
4
|
-
import type { Event } from '@notifee/react-native';
|
|
5
|
-
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
6
|
-
export declare const oniOSExpoNotificationEvent: (event: ExpoNotification) => void;
|
|
7
|
-
export declare const oniOSNotifeeEvent: ({ event }: {
|
|
8
|
-
event: Event;
|
|
9
|
-
}) => void;
|
|
10
|
-
export declare function onPushNotificationiOSStreamVideoEvent(notification: PushNotificationiOSType): void;
|
|
11
|
-
/** Send token to stream */
|
|
12
|
-
export declare function initIosNonVoipToken(client: StreamVideoClient, pushConfig: PushConfig, setUnsubscribeListener: (unsubscribe: () => void) => void): Promise<void>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=ios.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EACL,KAAK,gBAAgB,EAIrB,KAAK,uBAAuB,EAC7B,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,iBAAiB,EAAqB,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAuBzD,eAAO,MAAM,0BAA0B,GAAI,OAAO,gBAAgB,SAuBjE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,SAkB5D,CAAC;AAEF,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,uBAAuB,QAkCtC;AAED,2BAA2B;AAC3B,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBAiF1D"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Notification } from 'expo-notifications';
|
|
2
|
-
export type ExpoNotificationsLib = typeof import('expo-notifications');
|
|
3
|
-
export type ExpoNotification = Notification;
|
|
4
|
-
export declare function getExpoNotificationsLib(): typeof import("expo-notifications");
|
|
5
|
-
export declare function getExpoNotificationsLibNoThrow(): typeof import("expo-notifications") | undefined;
|
|
6
|
-
//# sourceMappingURL=expoNotifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expoNotifications.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/expoNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,MAAM,oBAAoB,GAAG,cAAc,oBAAoB,CAAC,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAQ5C,wBAAgB,uBAAuB,wCAOtC;AAED,wBAAgB,8BAA8B,oDAS7C"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PushNotification } from '@react-native-community/push-notification-ios';
|
|
2
|
-
export type PushNotificationIosLib = typeof import('@react-native-community/push-notification-ios').default;
|
|
3
|
-
export type PushNotificationiOSType = PushNotification;
|
|
4
|
-
export declare function getPushNotificationIosLib(): import("@react-native-community/push-notification-ios").PushNotificationIOSStatic;
|
|
5
|
-
//# sourceMappingURL=iosPushNotification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iosPushNotification.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/iosPushNotification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,MAAM,sBAAsB,GAChC,cAAc,+CAA+C,EAAE,OAAO,CAAC;AAIzE,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAOvD,wBAAgB,yBAAyB,sFAOxC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Type } from './lib';
|
|
2
|
-
export type NotifeeLib = Type;
|
|
3
|
-
declare enum AndroidForegroundServiceType {
|
|
4
|
-
FOREGROUND_SERVICE_TYPE_CAMERA = 64,
|
|
5
|
-
FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 16,
|
|
6
|
-
FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1,
|
|
7
|
-
FOREGROUND_SERVICE_TYPE_HEALTH = 256,
|
|
8
|
-
FOREGROUND_SERVICE_TYPE_LOCATION = 8,
|
|
9
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 2,
|
|
10
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 32,
|
|
11
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING = 8192,
|
|
12
|
-
FOREGROUND_SERVICE_TYPE_MICROPHONE = 128,
|
|
13
|
-
FOREGROUND_SERVICE_TYPE_PHONE_CALL = 4,
|
|
14
|
-
FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING = 512,
|
|
15
|
-
FOREGROUND_SERVICE_TYPE_SHORT_SERVICE = 2048,
|
|
16
|
-
FOREGROUND_SERVICE_TYPE_SPECIAL_USE = 1073741824,
|
|
17
|
-
FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 1024,
|
|
18
|
-
FOREGROUND_SERVICE_TYPE_MANIFEST = -1
|
|
19
|
-
}
|
|
20
|
-
export declare function getNotifeeLibThrowIfNotInstalledForPush(): typeof import("@notifee/react-native");
|
|
21
|
-
export declare function getIncomingCallForegroundServiceTypes(): AndroidForegroundServiceType[];
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/notifee/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAE9B,aAAK,4BAA4B;IAC/B,8BAA8B,KAAK;IACnC,wCAAwC,KAAK;IAC7C,iCAAiC,IAAI;IACrC,8BAA8B,MAAM;IACpC,gCAAgC,IAAI;IACpC,sCAAsC,IAAI;IAC1C,wCAAwC,KAAK;IAC7C,wCAAwC,OAAO;IAC/C,kCAAkC,MAAM;IACxC,kCAAkC,IAAI;IACtC,wCAAwC,MAAM;IAC9C,qCAAqC,OAAO;IAC5C,mCAAmC,aAAa;IAChD,uCAAuC,OAAO;IAC9C,gCAAgC,KAAK;CACtC;AAKD,wBAAgB,uCAAuC,2CAQtD;AAED,wBAAgB,qCAAqC,mCAKpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/notifee/lib.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,cAAc,uBAAuB,CAAC,CAAC;AAE1D,QAAA,IAAI,GAAG,EAAE,IAAI,GAAG,SAAS,CAAC;AAM1B,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useConnectedUser,
|
|
3
|
-
useStreamVideoClient,
|
|
4
|
-
} from '@stream-io/video-react-bindings';
|
|
5
|
-
import { useEffect } from 'react';
|
|
6
|
-
import { StreamVideoRN } from '../../utils';
|
|
7
|
-
import { initIosNonVoipToken } from '../../utils/push/ios';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* This hook is used to initialize the push token for iOS.
|
|
11
|
-
*/
|
|
12
|
-
export const useIosInitRemoteNotifications = () => {
|
|
13
|
-
const client = useStreamVideoClient();
|
|
14
|
-
const connectedUserId = useConnectedUser()?.id;
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
17
|
-
// NOTE: we need to wait for user to be connected before we can send the push token
|
|
18
|
-
if (!client || !connectedUserId || !pushConfig) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
let unsubscribe = () => {};
|
|
22
|
-
initIosNonVoipToken(client, pushConfig, (unsubscribeListener) => {
|
|
23
|
-
unsubscribe = unsubscribeListener;
|
|
24
|
-
});
|
|
25
|
-
return () => {
|
|
26
|
-
unsubscribe();
|
|
27
|
-
};
|
|
28
|
-
}, [client, connectedUserId]);
|
|
29
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { pushNonRingingCallData$ } from '../../utils/push/internal/rxSubjects';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { StreamVideoRN } from '../../utils';
|
|
4
|
-
import {
|
|
5
|
-
useConnectedUser,
|
|
6
|
-
useStreamVideoClient,
|
|
7
|
-
} from '@stream-io/video-react-bindings';
|
|
8
|
-
import { filter } from 'rxjs/operators';
|
|
9
|
-
import { processNonIncomingCallFromPush } from '../../utils/push/internal/utils';
|
|
10
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
|
|
14
|
-
* 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.
|
|
15
|
-
* So we essentially run this effect only when the client is connected with a websocket.
|
|
16
|
-
*/
|
|
17
|
-
export const useProcessPushNonRingingCallEffect = () => {
|
|
18
|
-
const client = useStreamVideoClient();
|
|
19
|
-
const connectedUserId = useConnectedUser()?.id;
|
|
20
|
-
// The Effect to automatically add the non ringing call to our low level client state
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
23
|
-
if (!pushConfig || !client || !connectedUserId) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const subscription = pushNonRingingCallData$
|
|
28
|
-
.pipe(filter(NotUndefined))
|
|
29
|
-
.subscribe(async ({ cid, type }) => {
|
|
30
|
-
videoLoggerSystem
|
|
31
|
-
.getLogger('useProcessPushNonRingingCallEffect')
|
|
32
|
-
.debug(
|
|
33
|
-
`processNonIncomingCallFromPush with callCId: ${cid} and type: ${type}`,
|
|
34
|
-
);
|
|
35
|
-
await processNonIncomingCallFromPush(client, cid, type);
|
|
36
|
-
pushNonRingingCallData$.next(undefined); // remove the current data to avoid processing again
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return () => {
|
|
40
|
-
subscription.unsubscribe();
|
|
41
|
-
};
|
|
42
|
-
}, [client, connectedUserId]);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* A type guard to check if the data is not undefined
|
|
47
|
-
*/
|
|
48
|
-
function NotUndefined<T>(data: T | undefined): data is T {
|
|
49
|
-
return data !== undefined;
|
|
50
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Call } from '@stream-io/video-client';
|
|
2
|
-
import { type NonRingingPushEvent } from '../StreamVideoRN/types';
|
|
3
|
-
|
|
4
|
-
export type NewCallNotificationCallback = (
|
|
5
|
-
call: Call,
|
|
6
|
-
notificationType: NonRingingPushEvent,
|
|
7
|
-
) => void;
|
|
8
|
-
|
|
9
|
-
type NewNotificationCallbacks = {
|
|
10
|
-
current?: NewCallNotificationCallback[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let lastCid = '';
|
|
14
|
-
|
|
15
|
-
const newNotificationCallbacks: NewNotificationCallbacks = {};
|
|
16
|
-
|
|
17
|
-
export const onNewCallNotification: NewCallNotificationCallback = (
|
|
18
|
-
call,
|
|
19
|
-
notificationType,
|
|
20
|
-
) => {
|
|
21
|
-
if (newNotificationCallbacks.current && lastCid !== call.cid) {
|
|
22
|
-
newNotificationCallbacks.current.forEach((callback) =>
|
|
23
|
-
callback(call, notificationType),
|
|
24
|
-
);
|
|
25
|
-
lastCid = call.cid;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default newNotificationCallbacks;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import type { NonRingingPushEvent } from '../../StreamVideoRN/types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This rxjs subject is used to store the call cid of the accepted incoming call from push notification
|
|
6
|
-
* Note: it is should be subscribed only when a user has connected to the websocket of Stream
|
|
7
|
-
*/
|
|
8
|
-
export const pushNonRingingCallData$ = new BehaviorSubject<
|
|
9
|
-
{ cid: string; type: NonRingingPushEvent } | undefined
|
|
10
|
-
>(undefined);
|
package/src/utils/push/ios.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
3
|
-
import { pushNonRingingCallData$ } from './internal/rxSubjects';
|
|
4
|
-
import {
|
|
5
|
-
type ExpoNotification,
|
|
6
|
-
getExpoNotificationsLib,
|
|
7
|
-
getNotifeeLibThrowIfNotInstalledForPush,
|
|
8
|
-
getPushNotificationIosLib,
|
|
9
|
-
type PushNotificationiOSType,
|
|
10
|
-
} from './libs';
|
|
11
|
-
import { StreamVideoClient, videoLoggerSystem } from '@stream-io/video-client';
|
|
12
|
-
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
13
|
-
import type { Event } from '@notifee/react-native';
|
|
14
|
-
import { StreamVideoRN } from '../StreamVideoRN';
|
|
15
|
-
import type { StreamPushPayload } from './utils';
|
|
16
|
-
|
|
17
|
-
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
18
|
-
|
|
19
|
-
let lastApnToken = { token: '', userId: '' };
|
|
20
|
-
|
|
21
|
-
function processNonRingingNotificationStreamPayload(
|
|
22
|
-
streamPayload: StreamPushPayload,
|
|
23
|
-
) {
|
|
24
|
-
if (
|
|
25
|
-
streamPayload?.sender === 'stream.video' &&
|
|
26
|
-
streamPayload?.type !== 'call.ring'
|
|
27
|
-
) {
|
|
28
|
-
const cid = streamPayload.call_cid;
|
|
29
|
-
const type = streamPayload.type;
|
|
30
|
-
const logger = videoLoggerSystem.getLogger(
|
|
31
|
-
'processNonRingingNotificationStreamPayload',
|
|
32
|
-
);
|
|
33
|
-
logger.trace(`cid, type - ${cid}, ${type}`);
|
|
34
|
-
pushNonRingingCallData$.next({ cid, type });
|
|
35
|
-
return { cid, type };
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const oniOSExpoNotificationEvent = (event: ExpoNotification) => {
|
|
41
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
42
|
-
if (pushConfig) {
|
|
43
|
-
const trigger = event.request.trigger;
|
|
44
|
-
if (
|
|
45
|
-
trigger &&
|
|
46
|
-
typeof trigger === 'object' &&
|
|
47
|
-
'type' in trigger &&
|
|
48
|
-
trigger.type === 'push' &&
|
|
49
|
-
trigger.payload?.stream
|
|
50
|
-
) {
|
|
51
|
-
const streamPayload = trigger.payload.stream as StreamPushPayload;
|
|
52
|
-
const logger = videoLoggerSystem.getLogger(
|
|
53
|
-
'processNonRingingNotificationStreamPayload',
|
|
54
|
-
);
|
|
55
|
-
logger.trace(
|
|
56
|
-
`processNonRingingNotificationStreamPayload - ${JSON.stringify(
|
|
57
|
-
streamPayload,
|
|
58
|
-
)}`,
|
|
59
|
-
);
|
|
60
|
-
processNonRingingNotificationStreamPayload(streamPayload);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const oniOSNotifeeEvent = ({ event }: { event: Event }) => {
|
|
66
|
-
if (Platform.OS !== 'ios') return;
|
|
67
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
68
|
-
const { type, detail } = event;
|
|
69
|
-
const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
|
|
70
|
-
if (pushConfig && type === notifeeLib.EventType.PRESS) {
|
|
71
|
-
const streamPayload = detail.notification?.data?.stream as
|
|
72
|
-
| StreamPushPayload
|
|
73
|
-
| undefined;
|
|
74
|
-
const result = processNonRingingNotificationStreamPayload(streamPayload);
|
|
75
|
-
if (result) {
|
|
76
|
-
const logger = videoLoggerSystem.getLogger('oniOSNotifeeEvent');
|
|
77
|
-
logger.debug(
|
|
78
|
-
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
79
|
-
);
|
|
80
|
-
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export function onPushNotificationiOSStreamVideoEvent(
|
|
86
|
-
notification: PushNotificationiOSType,
|
|
87
|
-
) {
|
|
88
|
-
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
89
|
-
const data = notification.getData();
|
|
90
|
-
const streamPayload = data?.stream as StreamPushPayload;
|
|
91
|
-
const logger = videoLoggerSystem.getLogger(
|
|
92
|
-
'onPushNotificationiOSStreamVideoEvent',
|
|
93
|
-
);
|
|
94
|
-
if (!streamPayload) {
|
|
95
|
-
logger.trace(
|
|
96
|
-
`skipping process: no stream payload found in notification data - ${JSON.stringify(
|
|
97
|
-
data,
|
|
98
|
-
)}`,
|
|
99
|
-
);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const isClicked = data.userInteraction === 1;
|
|
103
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
104
|
-
if (!isClicked || !pushConfig) {
|
|
105
|
-
logger.debug(
|
|
106
|
-
`notification.finish called and returning - isClicked: ${isClicked}, pushConfig: ${!!pushConfig}`,
|
|
107
|
-
);
|
|
108
|
-
notification.finish(pushNotificationIosLib.FetchResult.NoData);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
// listen to foreground notifications
|
|
112
|
-
const result = processNonRingingNotificationStreamPayload(streamPayload);
|
|
113
|
-
if (result) {
|
|
114
|
-
logger.debug(
|
|
115
|
-
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
116
|
-
);
|
|
117
|
-
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
118
|
-
}
|
|
119
|
-
notification.finish(pushNotificationIosLib.FetchResult.NoData);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** Send token to stream */
|
|
123
|
-
export async function initIosNonVoipToken(
|
|
124
|
-
client: StreamVideoClient,
|
|
125
|
-
pushConfig: PushConfig,
|
|
126
|
-
setUnsubscribeListener: (unsubscribe: () => void) => void,
|
|
127
|
-
) {
|
|
128
|
-
if (
|
|
129
|
-
Platform.OS !== 'ios' ||
|
|
130
|
-
!pushConfig.ios?.pushProviderName ||
|
|
131
|
-
!pushConfig.onTapNonRingingCallNotification
|
|
132
|
-
) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const logger = videoLoggerSystem.getLogger('initIosNonVoipToken');
|
|
137
|
-
const setDeviceToken = async (token: string) => {
|
|
138
|
-
const userId = client.streamClient._user?.id ?? '';
|
|
139
|
-
if (lastApnToken.token === token && lastApnToken.userId === userId) {
|
|
140
|
-
logger.debug(
|
|
141
|
-
'Skipped sending device token to stream as it was already sent',
|
|
142
|
-
token,
|
|
143
|
-
);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
setPushLogoutCallback(async () => {
|
|
147
|
-
lastApnToken = { token: '', userId: '' };
|
|
148
|
-
try {
|
|
149
|
-
logger.debug('Remove device token - setPushLogoutCallback', token);
|
|
150
|
-
await client.removeDevice(token);
|
|
151
|
-
} catch (err) {
|
|
152
|
-
logger.warn(
|
|
153
|
-
'setPushLogoutCallback - Failed to remove apn token from stream',
|
|
154
|
-
err,
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
const push_provider_name = pushConfig.ios?.pushProviderName;
|
|
159
|
-
logger.debug('Add device token to stream', token);
|
|
160
|
-
await client
|
|
161
|
-
.addDevice(token, 'apn', push_provider_name)
|
|
162
|
-
.then(() => {
|
|
163
|
-
lastApnToken = { token, userId };
|
|
164
|
-
})
|
|
165
|
-
.catch((err) => {
|
|
166
|
-
logger.warn('Failed to add apn token to stream', err);
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
if (pushConfig.isExpo) {
|
|
170
|
-
const expoNotificationsLib = getExpoNotificationsLib();
|
|
171
|
-
if (expoNotificationsLib) {
|
|
172
|
-
expoNotificationsLib.getDevicePushTokenAsync().then((devicePushToken) => {
|
|
173
|
-
logger.debug(
|
|
174
|
-
'Got device token - expoNotificationsLib.getDevicePushTokenAsync',
|
|
175
|
-
devicePushToken.data,
|
|
176
|
-
);
|
|
177
|
-
setDeviceToken(devicePushToken.data);
|
|
178
|
-
});
|
|
179
|
-
const subscription = expoNotificationsLib.addPushTokenListener(
|
|
180
|
-
(devicePushToken) => {
|
|
181
|
-
logger.debug(
|
|
182
|
-
'Got device token - expoNotificationsLib.addPushTokenListener',
|
|
183
|
-
devicePushToken.data,
|
|
184
|
-
);
|
|
185
|
-
setDeviceToken(devicePushToken.data);
|
|
186
|
-
},
|
|
187
|
-
);
|
|
188
|
-
setUnsubscribeListener(() => {
|
|
189
|
-
logger.debug(`removed expo addPushTokenListener`);
|
|
190
|
-
subscription.remove();
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
} else {
|
|
194
|
-
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
195
|
-
pushNotificationIosLib.addEventListener('register', (token) => {
|
|
196
|
-
logger.debug(
|
|
197
|
-
`Got device token - pushNotificationIosLib.addEventListener('register')`,
|
|
198
|
-
token,
|
|
199
|
-
);
|
|
200
|
-
setDeviceToken(token);
|
|
201
|
-
});
|
|
202
|
-
setUnsubscribeListener(() => {
|
|
203
|
-
logger.debug(`pushNotificationIosLib.removeEventListener('register')`);
|
|
204
|
-
pushNotificationIosLib.removeEventListener('register');
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Notification } from 'expo-notifications';
|
|
2
|
-
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
3
|
-
|
|
4
|
-
export type ExpoNotificationsLib = typeof import('expo-notifications');
|
|
5
|
-
|
|
6
|
-
export type ExpoNotification = Notification;
|
|
7
|
-
|
|
8
|
-
let expoNotificationsLib: ExpoNotificationsLib | undefined;
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
expoNotificationsLib = require('expo-notifications');
|
|
12
|
-
} catch {}
|
|
13
|
-
|
|
14
|
-
export function getExpoNotificationsLib() {
|
|
15
|
-
if (!expoNotificationsLib) {
|
|
16
|
-
throw Error(
|
|
17
|
-
'expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions. It is required for non ringing push notifications.',
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
return expoNotificationsLib;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function getExpoNotificationsLibNoThrow() {
|
|
24
|
-
if (!expoNotificationsLib) {
|
|
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
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return expoNotificationsLib;
|
|
32
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { PushNotification } from '@react-native-community/push-notification-ios';
|
|
2
|
-
|
|
3
|
-
export type PushNotificationIosLib =
|
|
4
|
-
typeof import('@react-native-community/push-notification-ios').default;
|
|
5
|
-
|
|
6
|
-
let pushNotificationIosLib: PushNotificationIosLib | undefined;
|
|
7
|
-
|
|
8
|
-
export type PushNotificationiOSType = PushNotification;
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
pushNotificationIosLib =
|
|
12
|
-
require('@react-native-community/push-notification-ios').default;
|
|
13
|
-
} catch {}
|
|
14
|
-
|
|
15
|
-
export function getPushNotificationIosLib() {
|
|
16
|
-
if (!pushNotificationIosLib) {
|
|
17
|
-
throw Error(
|
|
18
|
-
'@react-native-community/push-notification-ios library is not installed. Please install it using "yarn add @react-native-community/push-notification-ios" or "npm i @react-native-community/push-notification-ios --save"',
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
return pushNotificationIosLib;
|
|
22
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { lib, type Type } from './lib';
|
|
2
|
-
|
|
3
|
-
export type NotifeeLib = Type;
|
|
4
|
-
|
|
5
|
-
enum AndroidForegroundServiceType {
|
|
6
|
-
FOREGROUND_SERVICE_TYPE_CAMERA = 64,
|
|
7
|
-
FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 16,
|
|
8
|
-
FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1,
|
|
9
|
-
FOREGROUND_SERVICE_TYPE_HEALTH = 256,
|
|
10
|
-
FOREGROUND_SERVICE_TYPE_LOCATION = 8,
|
|
11
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 2,
|
|
12
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 32,
|
|
13
|
-
FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING = 8192,
|
|
14
|
-
FOREGROUND_SERVICE_TYPE_MICROPHONE = 128,
|
|
15
|
-
FOREGROUND_SERVICE_TYPE_PHONE_CALL = 4,
|
|
16
|
-
FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING = 512,
|
|
17
|
-
FOREGROUND_SERVICE_TYPE_SHORT_SERVICE = 2048,
|
|
18
|
-
FOREGROUND_SERVICE_TYPE_SPECIAL_USE = 1073741824,
|
|
19
|
-
FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 1024,
|
|
20
|
-
FOREGROUND_SERVICE_TYPE_MANIFEST = -1,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const INSTALLATION_INSTRUCTION =
|
|
24
|
-
'Please see https://notifee.app/react-native/docs/installation for installation instructions';
|
|
25
|
-
|
|
26
|
-
export function getNotifeeLibThrowIfNotInstalledForPush() {
|
|
27
|
-
if (!lib) {
|
|
28
|
-
throw Error(
|
|
29
|
-
'@notifee/react-native is not installed. It is required for implementing push notifications. ' +
|
|
30
|
-
INSTALLATION_INSTRUCTION,
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
return lib;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getIncomingCallForegroundServiceTypes() {
|
|
37
|
-
const types: AndroidForegroundServiceType[] = [
|
|
38
|
-
AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE,
|
|
39
|
-
];
|
|
40
|
-
return types;
|
|
41
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type Type = typeof import('@notifee/react-native');
|
|
2
|
-
|
|
3
|
-
let lib: Type | undefined;
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
lib = require('@notifee/react-native');
|
|
7
|
-
} catch {}
|
|
8
|
-
|
|
9
|
-
export { lib };
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
IMPORTANT: must keep a failing import in a different file
|
|
13
|
-
Else on commonjs, metro doesnt resolve any other modules properly in a file, if one of the module is not installed
|
|
14
|
-
*/
|