@stream-io/video-react-native-sdk 0.0.1-alpha.176 → 0.0.1-alpha.178
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 +13 -0
- package/README.md +7 -5
- package/dist/jest-setup.js +2 -0
- package/dist/jest-setup.js.map +1 -1
- package/dist/src/components/ParticipantReaction.js +29 -4
- package/dist/src/components/ParticipantReaction.js.map +1 -1
- package/dist/src/components/ReactionsModal.d.ts +1 -1
- package/dist/src/components/ReactionsModal.js +25 -2
- package/dist/src/components/ReactionsModal.js.map +1 -1
- package/dist/src/hooks/index.d.ts +2 -1
- package/dist/src/hooks/index.js +2 -1
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/push/index.d.ts +5 -0
- package/dist/src/hooks/push/index.js +19 -0
- package/dist/src/hooks/push/index.js.map +1 -0
- package/dist/src/hooks/push/useInitAndroidTokenAndRest.d.ts +4 -0
- package/dist/src/hooks/push/useInitAndroidTokenAndRest.js +24 -0
- package/dist/src/hooks/push/useInitAndroidTokenAndRest.js.map +1 -0
- package/dist/src/hooks/push/useIosCallKeepEffect.d.ts +4 -0
- package/dist/src/hooks/push/useIosCallKeepEffect.js +80 -0
- package/dist/src/hooks/push/useIosCallKeepEffect.js.map +1 -0
- package/dist/src/hooks/push/useIosPushEffect.d.ts +5 -0
- package/dist/src/hooks/push/useIosPushEffect.js +66 -0
- package/dist/src/hooks/push/useIosPushEffect.js.map +1 -0
- package/dist/src/hooks/push/useProcessPushCallEffect.d.ts +6 -0
- package/dist/src/hooks/push/useProcessPushCallEffect.js +51 -0
- package/dist/src/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/src/hooks/useAndroidKeepCallAliveEffect.d.ts +6 -0
- package/dist/src/hooks/useAndroidKeepCallAliveEffect.js +117 -0
- package/dist/src/hooks/useAndroidKeepCallAliveEffect.js.map +1 -0
- package/dist/src/providers/StreamCall.d.ts +1 -1
- package/dist/src/providers/StreamCall.js +17 -4
- package/dist/src/providers/StreamCall.js.map +1 -1
- package/dist/src/providers/StreamVideo.js +10 -0
- package/dist/src/providers/StreamVideo.js.map +1 -1
- package/dist/src/utils/StreamVideoRN/index.d.ts +24 -0
- package/dist/src/utils/StreamVideoRN/index.js +65 -0
- package/dist/src/utils/StreamVideoRN/index.js.map +1 -0
- package/dist/src/utils/StreamVideoRN/types.d.ts +103 -0
- package/dist/src/utils/StreamVideoRN/types.js +3 -0
- package/dist/src/utils/StreamVideoRN/types.js.map +1 -0
- package/dist/src/utils/push/libs.d.ts +9 -0
- package/dist/src/utils/push/libs.js +40 -0
- package/dist/src/utils/push/libs.js.map +1 -0
- package/dist/src/utils/push/rxSubjects.d.ts +3 -0
- package/dist/src/utils/push/rxSubjects.js +7 -0
- package/dist/src/utils/push/rxSubjects.js.map +1 -0
- package/dist/src/utils/push/utils.d.ts +17 -0
- package/dist/src/utils/push/utils.js +247 -0
- package/dist/src/utils/push/utils.js.map +1 -0
- package/dist/src/utils/verifyAndroidBluetoothPermissions.js +2 -1
- package/dist/src/utils/verifyAndroidBluetoothPermissions.js.map +1 -1
- package/package.json +25 -8
- package/src/components/ParticipantReaction.tsx +5 -4
- package/src/components/ReactionsModal.tsx +2 -2
- package/src/hooks/index.ts +2 -1
- package/src/hooks/push/index.ts +15 -0
- package/src/hooks/push/useInitAndroidTokenAndRest.ts +23 -0
- package/src/hooks/push/useIosCallKeepEffect.ts +103 -0
- package/src/hooks/push/useIosPushEffect.ts +66 -0
- package/src/hooks/push/useProcessPushCallEffect.ts +55 -0
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +99 -0
- package/src/providers/StreamCall.tsx +24 -6
- package/src/providers/StreamVideo.tsx +11 -0
- package/src/utils/StreamVideoRN/index.ts +69 -0
- package/src/utils/StreamVideoRN/types.ts +104 -0
- package/src/utils/push/libs.ts +50 -0
- package/src/utils/push/rxSubjects.ts +9 -0
- package/src/utils/push/utils.ts +255 -0
- package/src/utils/verifyAndroidBluetoothPermissions.ts +3 -1
- package/dist/src/hooks/useCallKeep.d.ts +0 -11
- package/dist/src/hooks/useCallKeep.js +0 -41
- package/dist/src/hooks/useCallKeep.js.map +0 -1
- package/dist/src/utils/StreamVideoRN.d.ts +0 -25
- package/dist/src/utils/StreamVideoRN.js +0 -23
- package/dist/src/utils/StreamVideoRN.js.map +0 -1
- package/src/hooks/useCallKeep.tsx +0 -51
- package/src/utils/StreamVideoRN.ts +0 -35
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useAndroidKeepCallAliveEffect = void 0;
|
|
27
|
+
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
28
|
+
const react_1 = require("react");
|
|
29
|
+
const react_native_1 = __importStar(require("@notifee/react-native"));
|
|
30
|
+
const utils_1 = require("../utils");
|
|
31
|
+
const react_native_2 = require("react-native");
|
|
32
|
+
const video_client_1 = require("@stream-io/video-client");
|
|
33
|
+
async function setForegroundService() {
|
|
34
|
+
if (react_native_2.Platform.OS !== 'android') {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const foregroundServiceConfig = utils_1.StreamVideoRN.getConfig().foregroundService;
|
|
38
|
+
await react_native_1.default.createChannel(foregroundServiceConfig.android.channel);
|
|
39
|
+
react_native_1.default.registerForegroundService(() => {
|
|
40
|
+
return new Promise(() => {
|
|
41
|
+
console.log('Foreground service running for call in progress');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async function startForegroundService() {
|
|
46
|
+
if (react_native_2.Platform.OS !== 'android') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const foregroundServiceConfig = utils_1.StreamVideoRN.getConfig().foregroundService;
|
|
50
|
+
const { title, body } = foregroundServiceConfig.android.notificationTexts;
|
|
51
|
+
const channelId = foregroundServiceConfig.android.channel.id;
|
|
52
|
+
await react_native_1.default.displayNotification({
|
|
53
|
+
title,
|
|
54
|
+
body,
|
|
55
|
+
android: {
|
|
56
|
+
channelId,
|
|
57
|
+
asForegroundService: true,
|
|
58
|
+
ongoing: true,
|
|
59
|
+
colorized: true,
|
|
60
|
+
pressAction: {
|
|
61
|
+
id: 'default',
|
|
62
|
+
launchActivity: 'default', // open the app when the notification is pressed
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async function stopForegroundService() {
|
|
68
|
+
if (react_native_2.Platform.OS !== 'android') {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await react_native_1.default.stopForegroundService();
|
|
72
|
+
}
|
|
73
|
+
// flag to check if setForegroundService has already been run once
|
|
74
|
+
let isSetForegroundServiceRan = false;
|
|
75
|
+
/**
|
|
76
|
+
* This hook is used to keep the call alive in the background for Android.
|
|
77
|
+
* It starts a foreground service to keep the call alive as soon as the call is joined
|
|
78
|
+
* and stops the foreground Service when the call is left.
|
|
79
|
+
*/
|
|
80
|
+
const useAndroidKeepCallAliveEffect = () => {
|
|
81
|
+
if (!isSetForegroundServiceRan && react_native_2.Platform.OS === 'android') {
|
|
82
|
+
isSetForegroundServiceRan = true;
|
|
83
|
+
setForegroundService().catch((err) => console.error('setForegroundService error:', err));
|
|
84
|
+
}
|
|
85
|
+
const foregroundServiceStartedRef = (0, react_1.useRef)(false);
|
|
86
|
+
const callingState = (0, video_react_bindings_1.useCallCallingState)();
|
|
87
|
+
(0, react_1.useEffect)(() => {
|
|
88
|
+
if (react_native_2.Platform.OS !== 'android') {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// start foreground service as soon as the call is joined
|
|
92
|
+
if (callingState === video_client_1.CallingState.JOINED) {
|
|
93
|
+
const run = async () => {
|
|
94
|
+
if (foregroundServiceStartedRef.current) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// request for notification permission and then start the foreground service
|
|
98
|
+
const settings = await react_native_1.default.requestPermission();
|
|
99
|
+
if (settings.authorizationStatus === react_native_1.AuthorizationStatus.AUTHORIZED) {
|
|
100
|
+
await startForegroundService();
|
|
101
|
+
foregroundServiceStartedRef.current = true;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
run();
|
|
105
|
+
return () => {
|
|
106
|
+
if (!foregroundServiceStartedRef.current) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// stop foreground service when the call is not active
|
|
110
|
+
stopForegroundService();
|
|
111
|
+
foregroundServiceStartedRef.current = false;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}, [callingState]);
|
|
115
|
+
};
|
|
116
|
+
exports.useAndroidKeepCallAliveEffect = useAndroidKeepCallAliveEffect;
|
|
117
|
+
//# sourceMappingURL=useAndroidKeepCallAliveEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAndroidKeepCallAliveEffect.js","sourceRoot":"","sources":["../../../src/hooks/useAndroidKeepCallAliveEffect.ts"],"names":[],"mappings":"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"}
|
|
@@ -41,7 +41,7 @@ export type StreamCallProps = InitStreamCall & {
|
|
|
41
41
|
*/
|
|
42
42
|
export declare const StreamCall: ({ callId, callType, call, callCycleHandlers, children, }: PropsWithChildren<StreamCallProps>) => JSX.Element;
|
|
43
43
|
/**
|
|
44
|
-
* Exclude types from
|
|
44
|
+
* Exclude types from documentation site, but we should still add doc comments
|
|
45
45
|
* @internal
|
|
46
46
|
*/
|
|
47
47
|
export type CallCycleHandlersType = {
|
|
@@ -38,28 +38,33 @@ const hooks_1 = require("../hooks");
|
|
|
38
38
|
const StreamCall = ({ callId, callType = 'default', call, callCycleHandlers = {}, children, }) => {
|
|
39
39
|
const videoClient = (0, video_react_bindings_1.useStreamVideoClient)();
|
|
40
40
|
const [activeCall, setActiveCall] = (0, react_1.useState)(() => {
|
|
41
|
-
if (call)
|
|
41
|
+
if (call) {
|
|
42
42
|
return call;
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
if (!videoClient || !callId || !callType) {
|
|
44
45
|
return;
|
|
46
|
+
}
|
|
45
47
|
return videoClient?.call(callType, callId);
|
|
46
48
|
});
|
|
47
49
|
// Effect to create a new call with the given call id and type if the call doesn't exist
|
|
48
50
|
(0, react_1.useEffect)(() => {
|
|
49
|
-
if (!videoClient)
|
|
51
|
+
if (!videoClient) {
|
|
50
52
|
return;
|
|
53
|
+
}
|
|
51
54
|
if (callId && callType && !activeCall) {
|
|
52
55
|
const newCall = videoClient.call(callType, callId);
|
|
53
56
|
setActiveCall(newCall);
|
|
54
57
|
}
|
|
55
58
|
return () => {
|
|
56
|
-
if (activeCall?.state.callingState === video_client_1.CallingState.LEFT)
|
|
59
|
+
if (activeCall?.state.callingState === video_client_1.CallingState.LEFT) {
|
|
57
60
|
return;
|
|
61
|
+
}
|
|
58
62
|
activeCall?.leave().catch((e) => console.log(e));
|
|
59
63
|
setActiveCall(undefined);
|
|
60
64
|
};
|
|
61
65
|
}, [activeCall, callId, callType, videoClient]);
|
|
62
66
|
return (<video_react_bindings_1.StreamCallProvider call={activeCall}>
|
|
67
|
+
<KeepCallAliveAndroid />
|
|
63
68
|
<exports.CallCycleLogicsWrapper callCycleHandlers={callCycleHandlers}>
|
|
64
69
|
{children}
|
|
65
70
|
</exports.CallCycleLogicsWrapper>
|
|
@@ -71,4 +76,12 @@ const CallCycleLogicsWrapper = ({ callCycleHandlers, children, }) => {
|
|
|
71
76
|
return <>{children}</>;
|
|
72
77
|
};
|
|
73
78
|
exports.CallCycleLogicsWrapper = CallCycleLogicsWrapper;
|
|
79
|
+
/**
|
|
80
|
+
* This is a renderless component is used to keep the call alive on Android device using useAndroidKeepCallAliveEffect.
|
|
81
|
+
* useAndroidKeepCallAliveEffect needs to called inside a child of StreamCallProvider.
|
|
82
|
+
*/
|
|
83
|
+
const KeepCallAliveAndroid = () => {
|
|
84
|
+
(0, hooks_1.useAndroidKeepCallAliveEffect)();
|
|
85
|
+
return null;
|
|
86
|
+
};
|
|
74
87
|
//# sourceMappingURL=StreamCall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamCall.js","sourceRoot":"","sources":["../../../src/providers/StreamCall.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAGyC;AACzC,+CAAsE;AACtE,0DAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"StreamCall.js","sourceRoot":"","sources":["../../../src/providers/StreamCall.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAGyC;AACzC,+CAAsE;AACtE,0DAA6D;AAC7D,oCAA6E;AAqC7E;;;;;;GAMG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,QAAQ,GAAG,SAAS,EACpB,IAAI,EACJ,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAC2B,EAAE,EAAE;IACvC,MAAM,WAAW,GAAG,IAAA,2CAAoB,GAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAmB,GAAG,EAAE;QAClE,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAC;SACb;QACD,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;YACxC,OAAO;SACR;QACD,OAAO,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,wFAAwF;IACxF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,IAAI,MAAM,IAAI,QAAQ,IAAI,CAAC,UAAU,EAAE;YACrC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACnD,aAAa,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,OAAO,GAAG,EAAE;YACV,IAAI,UAAU,EAAE,KAAK,CAAC,YAAY,KAAK,2BAAY,CAAC,IAAI,EAAE;gBACxD,OAAO;aACR;YACD,UAAU,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEhD,OAAO,CACL,CAAC,yCAAkB,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CACnC;MAAA,CAAC,oBAAoB,CAAC,AAAD,EACrB;MAAA,CAAC,8BAAsB,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAC3D;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,8BAAsB,CAC1B;IAAA,EAAE,yCAAkB,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,UAAU,cA8CrB;AAyCK,MAAM,sBAAsB,GAAG,CAAC,EACrC,iBAAiB,EACjB,QAAQ,GACuC,EAAE,EAAE;IACnD,IAAA,0BAAkB,EAAC,iBAAiB,CAAC,CAAC;IAEtC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzB,CAAC,CAAC;AAPW,QAAA,sBAAsB,0BAOjC;AAEF;;;GAGG;AACH,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,IAAA,qCAA6B,GAAE,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -32,6 +32,7 @@ const react_1 = __importStar(require("react"));
|
|
|
32
32
|
const StreamVideoContext_1 = require("../contexts/StreamVideoContext");
|
|
33
33
|
const netinfo_1 = __importDefault(require("@react-native-community/netinfo"));
|
|
34
34
|
const MediaDevices_1 = require("./MediaDevices");
|
|
35
|
+
const hooks_1 = require("../hooks");
|
|
35
36
|
/**
|
|
36
37
|
*
|
|
37
38
|
* @param props
|
|
@@ -58,9 +59,18 @@ const StreamVideo = (props) => {
|
|
|
58
59
|
return (<video_react_bindings_1.StreamVideo client={client} translationsOverrides={translationsOverrides} i18nInstance={i18nInstance} language={language}>
|
|
59
60
|
<StreamVideoContext_1.StreamVideoStoreProvider>
|
|
60
61
|
<MediaDevices_1.MediaDevices />
|
|
62
|
+
<PushRegister />
|
|
61
63
|
{children}
|
|
62
64
|
</StreamVideoContext_1.StreamVideoStoreProvider>
|
|
63
65
|
</video_react_bindings_1.StreamVideo>);
|
|
64
66
|
};
|
|
65
67
|
exports.StreamVideo = StreamVideo;
|
|
68
|
+
/**
|
|
69
|
+
* The usePushRegisterEffect needs to be a child of StreamVideoStoreProvider
|
|
70
|
+
* So we create a renderless component to use it
|
|
71
|
+
*/
|
|
72
|
+
const PushRegister = () => {
|
|
73
|
+
(0, hooks_1.usePushRegisterEffect)();
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
66
76
|
//# sourceMappingURL=StreamVideo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamVideo.js","sourceRoot":"","sources":["../../../src/providers/StreamVideo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAGyC;AACzC,+CAA4D;AAC5D,uEAA0E;AAC1E,8EAAsD;AACtD,iDAA8C;
|
|
1
|
+
{"version":3,"file":"StreamVideo.js","sourceRoot":"","sources":["../../../src/providers/StreamVideo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAGyC;AACzC,+CAA4D;AAC5D,uEAA0E;AAC1E,8EAAsD;AACtD,iDAA8C;AAC9C,oCAAiD;AAEjD;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CAAC,KAA0C,EAAE,EAAE;IACxE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,YAAY,EAAE,QAAQ,EAAE,GACvE,KAAK,CAAC;IAER;;OAEG;IACH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,WAAW,GAAG,iBAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE;YACrD,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;YACnD,MAAM,QAAQ,GAAG,WAAW,KAAK,KAAK,IAAI,mBAAmB,KAAK,KAAK,CAAC;YACxE,mEAAmE;YACnE,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,mBAAmB,CAAC;gBACpD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;aACtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACL,CAAC,kCAAmB,CAClB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAC7C,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;MAAA,CAAC,6CAAwB,CACvB;QAAA,CAAC,2BAAY,CAAC,AAAD,EACb;QAAA,CAAC,YAAY,CAAC,AAAD,EACb;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,6CAAwB,CAC5B;IAAA,EAAE,kCAAmB,CAAC,CACvB,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,WAAW,eAkCtB;AAEF;;;GAGG;AACH,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,IAAA,6BAAqB,GAAE,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StreamVideoConfig } from './types';
|
|
2
|
+
export declare class StreamVideoRN {
|
|
3
|
+
private static config;
|
|
4
|
+
/**
|
|
5
|
+
* Update the global config for StreamVideoRN except for push config.
|
|
6
|
+
* To set push config use `StreamVideoRN.setPushConfig` instead.
|
|
7
|
+
* This function accepts a partial config object that will be merged with the default config.
|
|
8
|
+
* @example StreamVideoRN.setConfig({ onOpenCallParticipantsInfoView: () => {} });
|
|
9
|
+
*/
|
|
10
|
+
static updateConfig(updateConfig: Partial<Omit<StreamVideoConfig, 'push'>>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Set the push config for StreamVideoRN.
|
|
13
|
+
* Note: This function can only be called once.
|
|
14
|
+
* It is necessary to call this function before AppRegistry.registerComponent since the app can be opened from a dead state through a push notification
|
|
15
|
+
* @example // in index.js
|
|
16
|
+
* import { AppRegistry } from 'react-native';
|
|
17
|
+
* import App from './App';
|
|
18
|
+
* // Set push config
|
|
19
|
+
* StreamVideoRN.setPushConfig(pushConfig); // set push config
|
|
20
|
+
* AppRegistry.registerComponent('app', () => App);
|
|
21
|
+
*/
|
|
22
|
+
static setPushConfig(pushConfig: NonNullable<StreamVideoConfig['push']>): void;
|
|
23
|
+
static getConfig(): StreamVideoConfig;
|
|
24
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StreamVideoRN = void 0;
|
|
4
|
+
const react_native_1 = require("@notifee/react-native");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const utils_1 = require("../push/utils");
|
|
7
|
+
const DEFAULT_STREAM_VIDEO_CONFIG = {
|
|
8
|
+
supportedReactions: constants_1.defaultEmojiReactions,
|
|
9
|
+
foregroundService: {
|
|
10
|
+
android: {
|
|
11
|
+
channel: {
|
|
12
|
+
id: 'stream_call_foreground_service',
|
|
13
|
+
name: 'Notification Service to keep call alive',
|
|
14
|
+
lights: false,
|
|
15
|
+
vibration: false,
|
|
16
|
+
importance: react_native_1.AndroidImportance.DEFAULT,
|
|
17
|
+
},
|
|
18
|
+
notificationTexts: {
|
|
19
|
+
title: 'Call in progress',
|
|
20
|
+
body: 'Tap to return to the call',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
class StreamVideoRN {
|
|
26
|
+
static config = DEFAULT_STREAM_VIDEO_CONFIG;
|
|
27
|
+
/**
|
|
28
|
+
* Update the global config for StreamVideoRN except for push config.
|
|
29
|
+
* To set push config use `StreamVideoRN.setPushConfig` instead.
|
|
30
|
+
* This function accepts a partial config object that will be merged with the default config.
|
|
31
|
+
* @example StreamVideoRN.setConfig({ onOpenCallParticipantsInfoView: () => {} });
|
|
32
|
+
*/
|
|
33
|
+
static updateConfig(updateConfig) {
|
|
34
|
+
this.config = {
|
|
35
|
+
...this.config,
|
|
36
|
+
...updateConfig,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Set the push config for StreamVideoRN.
|
|
41
|
+
* Note: This function can only be called once.
|
|
42
|
+
* It is necessary to call this function before AppRegistry.registerComponent since the app can be opened from a dead state through a push notification
|
|
43
|
+
* @example // in index.js
|
|
44
|
+
* import { AppRegistry } from 'react-native';
|
|
45
|
+
* import App from './App';
|
|
46
|
+
* // Set push config
|
|
47
|
+
* StreamVideoRN.setPushConfig(pushConfig); // set push config
|
|
48
|
+
* AppRegistry.registerComponent('app', () => App);
|
|
49
|
+
*/
|
|
50
|
+
static setPushConfig(pushConfig) {
|
|
51
|
+
if (this.config.push) {
|
|
52
|
+
console.log('setPushConfig: Ignoring this config as push config was already set');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.config.push = pushConfig;
|
|
56
|
+
// After getting the config we should setup callkeep and firebase handler asap to handle incoming calls from a dead state
|
|
57
|
+
(0, utils_1.setupCallkeep)(pushConfig).catch((err) => console.error('initializeCallKeep error:', err));
|
|
58
|
+
(0, utils_1.setupFirebaseHandlerAndroid)(pushConfig);
|
|
59
|
+
}
|
|
60
|
+
static getConfig() {
|
|
61
|
+
return this.config;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.StreamVideoRN = StreamVideoRN;
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/index.ts"],"names":[],"mappings":";;;AAAA,wDAA0D;AAC1D,+CAAwD;AACxD,yCAA2E;AAG3E,MAAM,2BAA2B,GAAsB;IACrD,kBAAkB,EAAE,iCAAqB;IACzC,iBAAiB,EAAE;QACjB,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,EAAE,EAAE,gCAAgC;gBACpC,IAAI,EAAE,yCAAyC;gBAC/C,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE,gCAAiB,CAAC,OAAO;aACtC;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,2BAA2B;aAClC;SACF;KACF;CACF,CAAC;AAEF,MAAa,aAAa;IAChB,MAAM,CAAC,MAAM,GAAG,2BAA2B,CAAC;IACpD;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,YAAsD;QACxE,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,IAAI,CAAC,MAAM;YACd,GAAG,YAAY;SAChB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,CAAC,UAAkD;QACrE,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YACpB,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAC;YACF,OAAO;SACR;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;QAC9B,yHAAyH;QACzH,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACtC,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAChD,CAAC;QACF,IAAA,mCAA2B,EAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;;AA3CH,sCA4CC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { StreamReaction, StreamVideoClient } from '@stream-io/video-client';
|
|
2
|
+
import { AndroidChannel } from '@notifee/react-native';
|
|
3
|
+
type StreamReactionType = StreamReaction & {
|
|
4
|
+
icon: string | JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type StreamVideoConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* Reactions that are to be supported in the app.
|
|
9
|
+
*
|
|
10
|
+
* Note: This is an array of reactions that is rendered in the Reaction list.
|
|
11
|
+
*/
|
|
12
|
+
supportedReactions: StreamReactionType[];
|
|
13
|
+
/**
|
|
14
|
+
* The configuration to be used for push notifications.
|
|
15
|
+
* If undefined, push notifications will not be enabled for the app
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
push?: {
|
|
19
|
+
ios: {
|
|
20
|
+
/** The name of the app */
|
|
21
|
+
appName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The name for the alias of push provider used for iOS
|
|
24
|
+
* @example "production-apn-video" or "staging-apn-video" based on the environment
|
|
25
|
+
*/
|
|
26
|
+
pushProviderName: string;
|
|
27
|
+
};
|
|
28
|
+
android: {
|
|
29
|
+
/**
|
|
30
|
+
* The texts shown in the notification to keep call alive in the background for Android using a foreground service.
|
|
31
|
+
*/
|
|
32
|
+
phoneCallingAccountPermissionTexts: {
|
|
33
|
+
alertTitle: string;
|
|
34
|
+
alertDescription: string;
|
|
35
|
+
cancelButton: string;
|
|
36
|
+
okButton: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The notification channel to be used for incoming calls for Android.
|
|
40
|
+
* @example
|
|
41
|
+
* {
|
|
42
|
+
* id: 'stream_incoming_call',
|
|
43
|
+
* name: 'Incoming call notifications',
|
|
44
|
+
* importance: AndroidImportance.HIGH
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
incomingCallChannel: AndroidChannel;
|
|
48
|
+
/**
|
|
49
|
+
* Functions to create the texts shown in the notification for incoming calls in Android.
|
|
50
|
+
* @example
|
|
51
|
+
* {
|
|
52
|
+
* title: (createdUserName: string) => `Incoming call from ${createdUserName}`,
|
|
53
|
+
* body: (createdUserName: string) => `Tap to answer the call`
|
|
54
|
+
* }
|
|
55
|
+
*/
|
|
56
|
+
incomingCallNotificationTextGetters: {
|
|
57
|
+
getTitle: (createdUserName: string) => string;
|
|
58
|
+
getBody: (createdUserName: string) => string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The name for the alias of push provider used for Android
|
|
62
|
+
* @example "production-fcm-video" or "staging-fcm-video" based on the environment
|
|
63
|
+
*/
|
|
64
|
+
pushProviderName: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* This function is used to create a custom video client.
|
|
68
|
+
* This is used create a video client for incoming calls in the background and inform call events to the server.
|
|
69
|
+
* If you are unable to create a video client, for example if you dont know the logged in user yet, return undefined.
|
|
70
|
+
* @example
|
|
71
|
+
* createStreamVideoClient: () => {
|
|
72
|
+
* const userId = await AsyncStorage.getItem('@userId');
|
|
73
|
+
* const userName = await AsyncStorage.getItem('@userName');
|
|
74
|
+
* const token = await AsyncStorage.getItem('@userToken');
|
|
75
|
+
* if (!username || !userToken) return undefined;
|
|
76
|
+
* const user = { id: userId, name: userName, token };
|
|
77
|
+
* return new StreamVideoClient({
|
|
78
|
+
* apiKey: STREAM_API_KEY,
|
|
79
|
+
* user,
|
|
80
|
+
* token,
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
createStreamVideoClient: () => Promise<StreamVideoClient | undefined>;
|
|
84
|
+
/** The callback that is called when a call is accepted, used for navigation */
|
|
85
|
+
navigateAcceptCall: () => void;
|
|
86
|
+
};
|
|
87
|
+
foregroundService: {
|
|
88
|
+
android: {
|
|
89
|
+
/**
|
|
90
|
+
* The notification channel to keep call alive in the background for Android using a foreground service.
|
|
91
|
+
*/
|
|
92
|
+
channel: AndroidChannel;
|
|
93
|
+
/**
|
|
94
|
+
* The texts shown in the notification to keep call alive in the background for Android using a foreground service.
|
|
95
|
+
*/
|
|
96
|
+
notificationTexts: {
|
|
97
|
+
title: string;
|
|
98
|
+
body: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react-native-callkeep" />
|
|
2
|
+
/// <reference types="react-native-voip-push-notification" />
|
|
3
|
+
export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
|
|
4
|
+
export type RNCallKeepType = typeof import('react-native-callkeep').default;
|
|
5
|
+
export type FirebaseMessagingType = typeof import('@react-native-firebase/messaging').default;
|
|
6
|
+
export type VoipPushNotificationType = typeof import('react-native-voip-push-notification').default;
|
|
7
|
+
export declare function getCallKeepLib(): typeof import("react-native-callkeep").default;
|
|
8
|
+
export declare function getFirebaseMessagingLib(): import("@react-native-firebase/app").ReactNativeFirebase.FirebaseModuleWithStatics<import("@react-native-firebase/messaging").FirebaseMessagingTypes.Module, import("@react-native-firebase/messaging").FirebaseMessagingTypes.Statics>;
|
|
9
|
+
export declare function getVoipPushNotificationLib(): typeof import("react-native-voip-push-notification").default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVoipPushNotificationLib = exports.getFirebaseMessagingLib = exports.getCallKeepLib = void 0;
|
|
4
|
+
let callkeep;
|
|
5
|
+
let messaging;
|
|
6
|
+
let voipPushNotification;
|
|
7
|
+
try {
|
|
8
|
+
callkeep = require('react-native-callkeep').default;
|
|
9
|
+
}
|
|
10
|
+
catch (e) { }
|
|
11
|
+
try {
|
|
12
|
+
messaging = require('@react-native-firebase/messaging').default;
|
|
13
|
+
}
|
|
14
|
+
catch (e) { }
|
|
15
|
+
try {
|
|
16
|
+
voipPushNotification = require('react-native-voip-push-notification').default;
|
|
17
|
+
}
|
|
18
|
+
catch (e) { }
|
|
19
|
+
function getCallKeepLib() {
|
|
20
|
+
if (!callkeep) {
|
|
21
|
+
throw Error('react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions');
|
|
22
|
+
}
|
|
23
|
+
return callkeep;
|
|
24
|
+
}
|
|
25
|
+
exports.getCallKeepLib = getCallKeepLib;
|
|
26
|
+
function getFirebaseMessagingLib() {
|
|
27
|
+
if (!messaging) {
|
|
28
|
+
throw Error('react-native-firebase library is not installed. Please see https://rnfirebase.io/messaging/usage#installation for installation instructions');
|
|
29
|
+
}
|
|
30
|
+
return messaging;
|
|
31
|
+
}
|
|
32
|
+
exports.getFirebaseMessagingLib = getFirebaseMessagingLib;
|
|
33
|
+
function getVoipPushNotificationLib() {
|
|
34
|
+
if (!voipPushNotification) {
|
|
35
|
+
throw Error("react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm install react-native-voip-push-notification'");
|
|
36
|
+
}
|
|
37
|
+
return voipPushNotification;
|
|
38
|
+
}
|
|
39
|
+
exports.getVoipPushNotificationLib = getVoipPushNotificationLib;
|
|
40
|
+
//# sourceMappingURL=libs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs.js","sourceRoot":"","sources":["../../../../src/utils/push/libs.ts"],"names":[],"mappings":";;;AAQA,IAAI,QAAoC,CAAC;AACzC,IAAI,SAA4C,CAAC;AACjD,IAAI,oBAA0D,CAAC;AAE/D,IAAI;IACF,QAAQ,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC;CACrD;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,IAAI;IACF,SAAS,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC;CACjE;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,IAAI;IACF,oBAAoB,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,OAAO,CAAC;CAC/E;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,SAAgB,cAAc;IAC5B,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,KAAK,CACT,oKAAoK,CACrK,CAAC;KACH;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAPD,wCAOC;AAED,SAAgB,uBAAuB;IACrC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,KAAK,CACT,6IAA6I,CAC9I,CAAC;KACH;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,0DAOC;AAED,SAAgB,0BAA0B;IACxC,IAAI,CAAC,oBAAoB,EAAE;QACzB,MAAM,KAAK,CACT,2LAA2L,CAC5L,CAAC;KACH;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAPD,gEAOC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pushRejectedIncomingCallCId$ = exports.pushAcceptedIncomingCallCId$ = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
exports.pushAcceptedIncomingCallCId$ = new rxjs_1.BehaviorSubject(undefined);
|
|
6
|
+
exports.pushRejectedIncomingCallCId$ = new rxjs_1.BehaviorSubject(undefined);
|
|
7
|
+
//# sourceMappingURL=rxSubjects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rxSubjects.js","sourceRoot":"","sources":["../../../../src/utils/push/rxSubjects.ts"],"names":[],"mappings":";;;AAAA,+BAAuC;AAE1B,QAAA,4BAA4B,GAAG,IAAI,sBAAe,CAE7D,SAAS,CAAC,CAAC;AAEA,QAAA,4BAA4B,GAAG,IAAI,sBAAe,CAE7D,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StreamVideoClient } from '@stream-io/video-client';
|
|
2
|
+
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
3
|
+
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
4
|
+
export declare function setupCallkeep(pushConfig: PushConfig): Promise<void>;
|
|
5
|
+
/** Setup Firebase push message handler **/
|
|
6
|
+
export declare function setupFirebaseHandlerAndroid(pushConfig: PushConfig): void;
|
|
7
|
+
/** Send token to stream, create notification channel, */
|
|
8
|
+
export declare function initAndroidPushTokenAndAskPermissions(client: StreamVideoClient, pushConfig: PushConfig): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* This function is used process the call from push notifications due to incoming call
|
|
11
|
+
* It does the following steps:
|
|
12
|
+
* 1. Get the call from the client if present or create a new call
|
|
13
|
+
* 2. Fetch the latest state of the call from the server if its not already in ringing state
|
|
14
|
+
* 3. Join or leave the call based on the user's action.
|
|
15
|
+
*/
|
|
16
|
+
export declare const processCallFromPush: (client: StreamVideoClient, call_cid: string, action: 'accept' | 'decline') => Promise<void>;
|
|
17
|
+
export {};
|