@stream-io/video-react-native-sdk 1.29.4-beta.0 → 1.30.0
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 +3162 -0
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/AndroidManifestNew.xml +0 -11
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
- package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +13 -7
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +50 -14
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +12 -9
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +19 -4
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +2 -0
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/index.js +6 -6
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/hooks/index.js +0 -11
- package/dist/commonjs/utils/hooks/index.js.map +1 -1
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +202 -151
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +34 -17
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +20 -32
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
- package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +19 -8
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +10 -4
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +52 -16
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +15 -12
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +20 -5
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/module/hooks/push/index.js +2 -0
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +0 -26
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/providers/StreamCall/index.js +6 -6
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +21 -33
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/hooks/index.js +0 -1
- package/dist/module/utils/hooks/index.js.map +1 -1
- package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +204 -153
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +34 -17
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +44 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +19 -29
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/callkeep.js +11 -0
- package/dist/module/utils/push/libs/callkeep.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +2 -1
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +18 -0
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
- package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +18 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +0 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/hooks/index.d.ts +0 -1
- package/dist/typescript/utils/hooks/index.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +2 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +2 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/index.d.ts +2 -1
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
- package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
- package/expo-config-plugin/dist/withAppDelegate.js +197 -19
- package/expo-config-plugin/dist/withMainActivity.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
- package/ios/PictureInPicture/PictureInPictureAvatarView.swift +273 -0
- package/ios/PictureInPicture/PictureInPictureConnectionQualityIndicator.swift +162 -0
- package/ios/PictureInPicture/PictureInPictureContent.swift +173 -0
- package/ios/PictureInPicture/PictureInPictureContentState.swift +123 -0
- package/ios/PictureInPicture/PictureInPictureDelegateProxy.swift +89 -0
- package/ios/PictureInPicture/PictureInPictureEnforcedStopAdapter.swift +166 -0
- package/ios/PictureInPicture/PictureInPictureLogger.swift +16 -0
- package/ios/PictureInPicture/PictureInPictureParticipantOverlayView.swift +217 -0
- package/ios/PictureInPicture/PictureInPictureReconnectionView.swift +193 -0
- package/ios/PictureInPicture/StreamAVPictureInPictureVideoCallViewController.swift +125 -7
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +237 -63
- package/ios/PictureInPicture/StreamPictureInPictureControllerProtocol.swift +30 -0
- package/ios/PictureInPicture/StreamPictureInPictureVideoRenderer.swift +384 -12
- package/ios/RTCViewPip.swift +187 -21
- package/ios/RTCViewPipManager.mm +9 -0
- package/ios/RTCViewPipManager.swift +3 -3
- package/ios/StreamInCallManager.m +0 -2
- package/ios/StreamInCallManager.swift +7 -19
- package/ios/StreamVideoReactNative.h +4 -7
- package/ios/StreamVideoReactNative.m +82 -189
- package/package.json +19 -14
- package/src/components/Call/CallContent/CallContent.tsx +16 -8
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +81 -15
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +36 -0
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +28 -14
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +19 -10
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +20 -5
- package/src/hooks/push/index.ts +2 -0
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
- package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
- package/src/index.ts +0 -1
- package/src/modules/call-manager/CallManager.ts +0 -36
- package/src/modules/call-manager/native-module.d.ts +0 -7
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +30 -40
- package/src/utils/StreamVideoRN/types.ts +29 -56
- package/src/utils/hooks/index.ts +0 -1
- package/src/utils/internal/registerSDKGlobals.ts +4 -47
- package/src/utils/push/android.ts +309 -227
- package/src/utils/push/internal/ios.ts +44 -28
- package/src/utils/push/internal/rxSubjects.ts +61 -0
- package/src/utils/push/internal/utils.ts +26 -45
- package/src/utils/push/ios.ts +6 -1
- package/src/utils/push/libs/callkeep.ts +16 -0
- package/src/utils/push/libs/index.ts +2 -1
- package/src/utils/push/libs/notifee/index.ts +27 -0
- package/src/utils/push/libs/voipPushNotification.ts +17 -0
- package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
- package/src/version.ts +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/utils/hooks/useDebouncedValue.js +0 -24
- package/dist/commonjs/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callingx.js +0 -75
- package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/module/utils/hooks/useDebouncedValue.js +0 -19
- package/dist/module/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/module/utils/internal/callingx/callingx.js +0 -100
- package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/module/utils/push/libs/callingx.js +0 -67
- package/dist/module/utils/push/libs/callingx.js.map +0 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
- package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts +0 -8
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -14
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
- package/src/utils/hooks/useDebouncedValue.ts +0 -21
- package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
- package/src/utils/internal/callingx/callingx.ts +0 -146
- package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
- package/src/utils/push/libs/callingx.ts +0 -90
- package/src/utils/push/setupCallingExpEvents.ts +0 -130
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useProcessPushCallEffect = void 0;
|
|
7
|
+
var _rxSubjects = require("../../utils/push/internal/rxSubjects");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
var _videoReactBindings = require("@stream-io/video-react-bindings");
|
|
11
|
+
var _operators = require("rxjs/operators");
|
|
12
|
+
var _utils2 = require("../../utils/push/internal/utils");
|
|
13
|
+
var _videoClient = require("@stream-io/video-client");
|
|
14
|
+
/**
|
|
15
|
+
* This hook is used to process the incoming call data via push notifications using the relevant rxjs subjects
|
|
16
|
+
* It either joins or leaves the call based on the user's action.
|
|
17
|
+
* 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.
|
|
18
|
+
* So we essentially run this effect only when the client is connected with a websocket.
|
|
19
|
+
*/
|
|
20
|
+
const useProcessPushCallEffect = () => {
|
|
21
|
+
const client = (0, _videoReactBindings.useStreamVideoClient)();
|
|
22
|
+
const connectedUserId = (0, _videoReactBindings.useConnectedUser)()?.id;
|
|
23
|
+
// The Effect to join/reject call automatically when incoming call was received and processed from push notification
|
|
24
|
+
(0, _react.useEffect)(() => {
|
|
25
|
+
const pushConfig = _utils.StreamVideoRN.getConfig().push;
|
|
26
|
+
if (!pushConfig || !client || !connectedUserId) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
_videoClient.videoLoggerSystem.getLogger('useProcessPushCallEffect').debug(`Adding subscriptions to process incoming call from push notification`);
|
|
30
|
+
|
|
31
|
+
// if the user accepts the call from push notification we join the call
|
|
32
|
+
const acceptedCallSubscription = createCallSubscription(_rxSubjects.pushAcceptedIncomingCallCId$, client, pushConfig, 'accept');
|
|
33
|
+
|
|
34
|
+
// if the user rejects the call from push notification we leave the call
|
|
35
|
+
const declinedCallSubscription = createCallSubscription(_rxSubjects.pushRejectedIncomingCallCId$, client, pushConfig, 'decline');
|
|
36
|
+
|
|
37
|
+
// if the user taps the call from push notification we do nothing as the only thing is to get the call which adds it to the client
|
|
38
|
+
const pressedCallSubscription = createCallSubscription(_rxSubjects.pushTappedIncomingCallCId$, client, pushConfig, 'pressed');
|
|
39
|
+
const backgroundIncomingDeliveredCallSubscription = createCallSubscription(_rxSubjects.pushAndroidBackgroundDeliveredIncomingCallCId$, client, pushConfig, 'backgroundDelivered');
|
|
40
|
+
return () => {
|
|
41
|
+
acceptedCallSubscription.unsubscribe();
|
|
42
|
+
declinedCallSubscription.unsubscribe();
|
|
43
|
+
pressedCallSubscription.unsubscribe();
|
|
44
|
+
backgroundIncomingDeliveredCallSubscription.unsubscribe();
|
|
45
|
+
};
|
|
46
|
+
}, [client, connectedUserId]);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A type guard to check if the cid is not undefined
|
|
51
|
+
*/
|
|
52
|
+
exports.useProcessPushCallEffect = useProcessPushCallEffect;
|
|
53
|
+
function cidIsNotUndefined(cid) {
|
|
54
|
+
return cid !== undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The common logic to create a subscription for the given call cid and action
|
|
59
|
+
*/
|
|
60
|
+
const createCallSubscription = (behaviourSubjectWithCallCid, client, pushConfig, action) => {
|
|
61
|
+
return behaviourSubjectWithCallCid.pipe((0, _operators.distinctUntilChanged)(), (0, _operators.filter)(cidIsNotUndefined)).subscribe(async callCId => {
|
|
62
|
+
_videoClient.videoLoggerSystem.getLogger('useProcessPushCallEffect').debug(`Processing call from push notification with action: ${action} and callCId: ${callCId}`);
|
|
63
|
+
await (0, _utils2.processCallFromPush)(client, callCId, action, pushConfig);
|
|
64
|
+
behaviourSubjectWithCallCid.next(undefined); // remove the current call id to avoid processing again
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=useProcessPushCallEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_rxSubjects","require","_react","_utils","_videoReactBindings","_operators","_utils2","_videoClient","useProcessPushCallEffect","client","useStreamVideoClient","connectedUserId","useConnectedUser","id","useEffect","pushConfig","StreamVideoRN","getConfig","push","videoLoggerSystem","getLogger","debug","acceptedCallSubscription","createCallSubscription","pushAcceptedIncomingCallCId$","declinedCallSubscription","pushRejectedIncomingCallCId$","pressedCallSubscription","pushTappedIncomingCallCId$","backgroundIncomingDeliveredCallSubscription","pushAndroidBackgroundDeliveredIncomingCallCId$","unsubscribe","exports","cidIsNotUndefined","cid","undefined","behaviourSubjectWithCallCid","action","pipe","distinctUntilChanged","filter","subscribe","callCId","processCallFromPush","next"],"sourceRoot":"../../../../src","sources":["hooks/push/useProcessPushCallEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,wBAAwB,GAAGA,CAAA,KAAM;EAC5C,MAAMC,MAAM,GAAG,IAAAC,wCAAoB,EAAC,CAAC;EACrC,MAAMC,eAAe,GAAG,IAAAC,oCAAgB,EAAC,CAAC,EAAEC,EAAE;EAC9C;EACA,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,UAAU,GAAGC,oBAAa,CAACC,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD,IAAI,CAACH,UAAU,IAAI,CAACN,MAAM,IAAI,CAACE,eAAe,EAAE;MAC9C;IACF;IAEAQ,8BAAiB,CACdC,SAAS,CAAC,0BAA0B,CAAC,CACrCC,KAAK,CACJ,sEACF,CAAC;;IAEH;IACA,MAAMC,wBAAwB,GA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B,UAAU,CAAC;IAC9DqB,2BAA2B,CAACQ,IAAI,CAACT,SAAS,CAAC,CAAC,CAAC;EAC/C,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -9,56 +9,91 @@ var _react = require("react");
|
|
|
9
9
|
var _utils = require("../utils");
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
var _videoClient = require("@stream-io/video-client");
|
|
12
|
-
var _keepCallAliveHeadlessTask = require("../utils/keepCallAliveHeadlessTask");
|
|
13
12
|
var _notifee = require("../utils/push/libs/notifee");
|
|
14
|
-
var _libs = require("../utils/push/libs");
|
|
15
13
|
const notifeeLib = (0, _notifee.getNotifeeLibNoThrowForKeepCallAlive)();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
const callToPassToForegroundService = {
|
|
15
|
+
current: undefined
|
|
16
|
+
};
|
|
17
|
+
function setForegroundService() {
|
|
18
|
+
if (_reactNative.Platform.OS === 'ios' || !notifeeLib) return;
|
|
19
|
+
_reactNative.NativeModules.StreamVideoReactNative.isCallAliveConfigured().then(isConfigured => {
|
|
20
|
+
if (!isConfigured) {
|
|
21
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('setForegroundService method');
|
|
22
|
+
logger.info('KeepCallAlive is not configured. Skipping foreground service setup.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
notifeeLib.default.registerForegroundService(() => {
|
|
26
|
+
const task = new Promise(resolve => {
|
|
27
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('setForegroundService method');
|
|
28
|
+
logger.info('Foreground service running for call in progress');
|
|
29
|
+
// any task to run from SDK in the foreground service must be added
|
|
30
|
+
resolve(true);
|
|
31
|
+
});
|
|
32
|
+
const videoConfig = _utils.StreamVideoRN.getConfig();
|
|
33
|
+
const foregroundServiceConfig = videoConfig.foregroundService;
|
|
34
|
+
const {
|
|
35
|
+
taskToRun
|
|
36
|
+
} = foregroundServiceConfig.android;
|
|
37
|
+
const call = callToPassToForegroundService.current;
|
|
38
|
+
if (!call) {
|
|
39
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('setForegroundService method');
|
|
40
|
+
logger.warn('No call to pass to foreground service');
|
|
41
|
+
return task.then(() => new Promise(() => {}));
|
|
42
|
+
}
|
|
43
|
+
callToPassToForegroundService.current = undefined;
|
|
44
|
+
return task.then(() => taskToRun(call));
|
|
45
|
+
});
|
|
46
|
+
});
|
|
23
47
|
}
|
|
24
48
|
async function startForegroundService(call_cid) {
|
|
25
|
-
const
|
|
26
|
-
const isCallAliveConfigured = await (async () => {
|
|
27
|
-
try {
|
|
28
|
-
return await _reactNative.NativeModules.StreamVideoReactNative.isCallAliveConfigured();
|
|
29
|
-
} catch (e) {
|
|
30
|
-
logger.warn('Failed to check whether KeepCallAlive is configured', e);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
})();
|
|
49
|
+
const isCallAliveConfigured = await _reactNative.NativeModules.StreamVideoReactNative.isCallAliveConfigured();
|
|
34
50
|
if (!isCallAliveConfigured) {
|
|
51
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('startForegroundService');
|
|
35
52
|
logger.info('KeepCallAlive is not configured. Skipping foreground service setup.');
|
|
36
53
|
return;
|
|
37
54
|
}
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
// check for notification permission and then start the foreground service
|
|
56
|
+
if (!notifeeLib) return;
|
|
57
|
+
const settings = await notifeeLib.default.getNotificationSettings();
|
|
58
|
+
if (settings.authorizationStatus !== notifeeLib.AuthorizationStatus.AUTHORIZED) {
|
|
59
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('startForegroundService');
|
|
41
60
|
logger.info('Notification permission not granted, can not start foreground service to keep the call alive');
|
|
42
61
|
return;
|
|
43
62
|
}
|
|
44
63
|
const videoConfig = _utils.StreamVideoRN.getConfig();
|
|
45
64
|
const foregroundServiceConfig = videoConfig.foregroundService;
|
|
46
65
|
const notificationTexts = foregroundServiceConfig.android.notificationTexts;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
const channelId = foregroundServiceConfig.android.channel.id;
|
|
67
|
+
await notifeeLib.default.createChannel(foregroundServiceConfig.android.channel);
|
|
68
|
+
const foregroundServiceTypes = await (0, _notifee.getKeepCallAliveForegroundServiceTypes)();
|
|
50
69
|
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
51
70
|
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
52
71
|
// this crash was reproducible only in some android devices
|
|
53
|
-
requestAnimationFrame(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
requestAnimationFrame(() => {
|
|
73
|
+
notifeeLib.default.displayNotification({
|
|
74
|
+
id: call_cid,
|
|
75
|
+
title: notificationTexts.title,
|
|
76
|
+
body: notificationTexts.body,
|
|
77
|
+
android: {
|
|
78
|
+
channelId,
|
|
79
|
+
smallIcon: videoConfig.push?.android.smallIcon,
|
|
80
|
+
foregroundServiceTypes,
|
|
81
|
+
asForegroundService: true,
|
|
82
|
+
ongoing: true,
|
|
83
|
+
// user cannot dismiss the notification
|
|
84
|
+
colorized: true,
|
|
85
|
+
pressAction: {
|
|
86
|
+
id: 'default',
|
|
87
|
+
launchActivity: 'default' // open the app when the notification is pressed
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
59
91
|
});
|
|
60
92
|
}
|
|
61
93
|
|
|
94
|
+
// flag to check if setForegroundService has already been run once
|
|
95
|
+
let isSetForegroundServiceRan = false;
|
|
96
|
+
|
|
62
97
|
/**
|
|
63
98
|
* This hook is used to keep the call alive in the background for Android.
|
|
64
99
|
* It starts a foreground service to keep the call alive as soon as the call is joined
|
|
@@ -68,7 +103,7 @@ async function startForegroundService(call_cid) {
|
|
|
68
103
|
const useAndroidKeepCallAliveEffect = () => {
|
|
69
104
|
const foregroundServiceStartedRef = (0, _react.useRef)(false);
|
|
70
105
|
const call = (0, _videoReactBindings.useCall)();
|
|
71
|
-
|
|
106
|
+
callToPassToForegroundService.current = call;
|
|
72
107
|
const activeCallCid = call?.cid;
|
|
73
108
|
const {
|
|
74
109
|
useCallCallingState
|
|
@@ -76,16 +111,12 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
76
111
|
const callingState = useCallCallingState();
|
|
77
112
|
const isOutgoingCall = callingState === _videoClient.CallingState.RINGING && call?.isCreatedByMe;
|
|
78
113
|
const isCallJoined = callingState === _videoClient.CallingState.JOINED;
|
|
79
|
-
const isRingingCall = call?.ringing;
|
|
80
114
|
const shouldStartForegroundService = !foregroundServiceStartedRef.current && (isOutgoingCall || isCallJoined);
|
|
81
115
|
(0, _react.useEffect)(() => {
|
|
82
116
|
if (_reactNative.Platform.OS === 'ios' || !activeCallCid) {
|
|
83
117
|
return undefined;
|
|
84
118
|
}
|
|
85
|
-
|
|
86
|
-
if (callingx?.isSetup && (isRingingCall || !isRingingCall && callingx?.isOngoingCallsEnabled)) {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
119
|
+
if (!notifeeLib) return undefined;
|
|
89
120
|
|
|
90
121
|
// start foreground service as soon as the call is joined
|
|
91
122
|
if (shouldStartForegroundService) {
|
|
@@ -93,18 +124,21 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
93
124
|
if (foregroundServiceStartedRef.current) {
|
|
94
125
|
return;
|
|
95
126
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
127
|
+
if (!isSetForegroundServiceRan) {
|
|
128
|
+
isSetForegroundServiceRan = true;
|
|
129
|
+
setForegroundService();
|
|
130
|
+
}
|
|
131
|
+
const notifee = notifeeLib.default;
|
|
132
|
+
const displayedNotifications = await notifee.getDisplayedNotifications();
|
|
133
|
+
const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
|
|
134
|
+
if (activeCallNotification) {
|
|
135
|
+
callToPassToForegroundService.current = undefined;
|
|
136
|
+
// this means that we have a incoming call notification shown as foreground service and we must stop it
|
|
137
|
+
notifee.stopForegroundService();
|
|
138
|
+
notifee.cancelDisplayedNotification(activeCallCid);
|
|
107
139
|
}
|
|
140
|
+
// check for notification permission and then start the foreground service
|
|
141
|
+
|
|
108
142
|
await startForegroundService(activeCallCid);
|
|
109
143
|
foregroundServiceStartedRef.current = true;
|
|
110
144
|
};
|
|
@@ -112,6 +146,7 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
112
146
|
// ensure that app is active before running the function
|
|
113
147
|
if (_reactNative.AppState.currentState === 'active') {
|
|
114
148
|
run();
|
|
149
|
+
return undefined;
|
|
115
150
|
}
|
|
116
151
|
const sub = _reactNative.AppState.addEventListener('change', nextAppState => {
|
|
117
152
|
if (nextAppState === 'active') {
|
|
@@ -126,36 +161,34 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
126
161
|
return () => {
|
|
127
162
|
// cancel any notifee displayed notification when the call has transitioned out of ringing
|
|
128
163
|
// NOTE: cancels only the non fg service notifications
|
|
129
|
-
|
|
130
|
-
notifeeLib.default.cancelDisplayedNotification(activeCallCid);
|
|
131
|
-
}
|
|
164
|
+
notifeeLib.default.cancelDisplayedNotification(activeCallCid);
|
|
132
165
|
};
|
|
133
166
|
} else if (callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.LEFT) {
|
|
134
167
|
if (foregroundServiceStartedRef.current) {
|
|
135
|
-
|
|
168
|
+
callToPassToForegroundService.current = undefined;
|
|
136
169
|
// stop foreground service when the call is not active
|
|
137
|
-
|
|
170
|
+
notifeeLib.default.stopForegroundService();
|
|
138
171
|
foregroundServiceStartedRef.current = false;
|
|
139
172
|
} else {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
173
|
+
notifeeLib.default.getDisplayedNotifications().then(displayedNotifications => {
|
|
174
|
+
const activeCallNotification = displayedNotifications.find(notification => notification.id === activeCallCid);
|
|
175
|
+
if (activeCallNotification) {
|
|
176
|
+
callToPassToForegroundService.current = undefined;
|
|
177
|
+
// this means that we have a incoming call notification shown as foreground service and we must stop it
|
|
178
|
+
notifeeLib.default.stopForegroundService();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
149
181
|
}
|
|
150
182
|
}
|
|
151
183
|
return undefined;
|
|
152
|
-
}, [activeCallCid, callingState, shouldStartForegroundService
|
|
184
|
+
}, [activeCallCid, callingState, shouldStartForegroundService]);
|
|
153
185
|
(0, _react.useEffect)(() => {
|
|
154
186
|
return () => {
|
|
155
187
|
// stop foreground service when this effect is unmounted
|
|
156
188
|
if (foregroundServiceStartedRef.current) {
|
|
157
|
-
|
|
158
|
-
|
|
189
|
+
if (!notifeeLib) return;
|
|
190
|
+
callToPassToForegroundService.current = undefined;
|
|
191
|
+
notifeeLib.default.stopForegroundService();
|
|
159
192
|
foregroundServiceStartedRef.current = false;
|
|
160
193
|
}
|
|
161
194
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","_notifee","notifeeLib","getNotifeeLibNoThrowForKeepCallAlive","callToPassToForegroundService","current","undefined","setForegroundService","Platform","OS","NativeModules","StreamVideoReactNative","isCallAliveConfigured","then","isConfigured","logger","videoLoggerSystem","getLogger","info","default","registerForegroundService","task","Promise","resolve","videoConfig","StreamVideoRN","getConfig","foregroundServiceConfig","foregroundService","taskToRun","android","call","warn","startForegroundService","call_cid","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","notificationTexts","channelId","channel","id","createChannel","foregroundServiceTypes","getKeepCallAliveForegroundServiceTypes","requestAnimationFrame","displayNotification","title","body","smallIcon","push","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","useRef","useCall","activeCallCid","cid","useCallCallingState","useCallStateHooks","callingState","isOutgoingCall","CallingState","RINGING","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","useEffect","run","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","AppState","currentState","sub","addEventListener","nextAppState","remove","IDLE","LEFT","exports"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,MAAMM,UAAU,GAAG,IAAAC,6CAAoC,EAAC,CAAC;AACzD,MAAMC,6BAA4D,GAAG;EACnEC,OAAO,EAAEC;AACX,CAAC;AAED,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI,CAACP,UAAU,EAAE;EAC1CQ,0BAAa,CAACC,sBAAsB,CAACC,qBAAqB,CAAC,CAAC,CAACC,IAAI,CAC9DC,YAAqB,IAAK;IACzB,IAAI,CAACA,YAAY,EAAE;MACjB,MAAMC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CACxC,6BACF,CAAC;MACDF,MAAM,CAACG,IAAI,CACT,qEACF,CAAC;MACD;IACF;IACAhB,UAAU,CAACiB,OAAO,CAACC,yBAAyB,CAAC,MAAM;MACjD,MAAMC,IAAI,GAAG,IAAIC,OAAO,CAAEC,OAAO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KoB,aACxC,CAAC;UACD,IAAIiB,sBAAsB,EAAE;YAC1B5E,6BAA6B,CAACC,OAAO,GAAGC,SAAS;YACjD;YACAJ,UAAU,CAACiB,OAAO,CAACgE,qBAAqB,CAAC,CAAC;UAC5C;QACF,CAAC,CAAC;MACN;IACF;IACA,OAAO7E,SAAS;EAClB,CAAC,EAAE,CAACyD,aAAa,EAAEI,YAAY,EAAEO,4BAA4B,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAIf,2BAA2B,CAACvD,OAAO,EAAE;QACvC,IAAI,CAACH,UAAU,EAAE;QACjBE,6BAA6B,CAACC,OAAO,GAAGC,SAAS;QACjDJ,UAAU,CAACiB,OAAO,CAACgE,qBAAqB,CAAC,CAAC;QAC1CvB,2BAA2B,CAACvD,OAAO,GAAG,KAAK;MAC7C;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAACwF,OAAA,CAAAlC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -27,7 +27,6 @@ var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
|
|
|
27
27
|
var _Logger = _interopRequireDefault(require("@stream-io/react-native-webrtc/src/Logger"));
|
|
28
28
|
var _reactNative = require("react-native");
|
|
29
29
|
var _registerSDKGlobals = require("./utils/internal/registerSDKGlobals");
|
|
30
|
-
require("./utils/keepCallAliveHeadlessTask");
|
|
31
30
|
var _videoClient = require("@stream-io/video-client");
|
|
32
31
|
Object.keys(_videoClient).forEach(function (key) {
|
|
33
32
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_setClientDetails","require","_reactNativeWebrtc","_Logger","_interopRequireDefault","_reactNative","_registerSDKGlobals","_videoClient","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_videoReactBindings","_components","_contexts","_hooks","_theme","_utils","_translations","_callManager","_StreamVideo","_StreamCall","_NoiseCancellation","e","__esModule","default","Platform","OS","registerGlobals","registerSDKGlobals","Logger","enable","ROOT_PREFIX","setClientDetails"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEAA,OAAA;AAEAA,OAAA;AAEAA,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;
|
|
1
|
+
{"version":3,"names":["_setClientDetails","require","_reactNativeWebrtc","_Logger","_interopRequireDefault","_reactNative","_registerSDKGlobals","_videoClient","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_videoReactBindings","_components","_contexts","_hooks","_theme","_utils","_translations","_callManager","_StreamVideo","_StreamCall","_NoiseCancellation","e","__esModule","default","Platform","OS","registerGlobals","registerSDKGlobals","Logger","enable","ROOT_PREFIX","setClientDetails"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEAA,OAAA;AAEAA,OAAA;AAEAA,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAaA,IAAAM,YAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,YAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAA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AA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,YAAA,CAAAhB,GAAA;IAAA;EAAA;AAAA;AAIA,IAAAiB,YAAA,GAAA3B,OAAA;AACA,IAAA4B,WAAA,GAAA5B,OAAA;AACA,IAAA6B,kBAAA,GAAA7B,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAqB,kBAAA,EAAApB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAmB,kBAAA,CAAAnB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAW,kBAAA,CAAAnB,GAAA;IAAA;EAAA;AAAA;AAA8C,SAAAP,uBAAA2B,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApC9C;;AAEA;;AAEA;;AAOA;AACA;AACA;AACA,IAAIG,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;EACzB,IAAAC,kCAAe,EAAC,CAAC;EACjB,IAAAC,sCAAkB,EAAC,CAAC;AACtB;;AAEA;AACAC,eAAM,CAACC,MAAM,CAAC,GAAGD,eAAM,CAACE,WAAW,eAAe,CAAC;;AAYnD;AACA;;AAKA,IAAAC,kCAAgB,EAAC,CAAC","ignoreList":[]}
|
|
@@ -5,10 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CallManager = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
var _callingx = require("../../utils/push/libs/callingx");
|
|
9
|
-
var _videoClient = require("@stream-io/video-client");
|
|
10
8
|
const NativeManager = _reactNative.NativeModules.StreamInCallManager;
|
|
11
|
-
const CallingxModule = (0, _callingx.getCallingxLibIfAvailable)();
|
|
12
9
|
const invariant = (condition, message) => {
|
|
13
10
|
if (!condition) throw new Error(message);
|
|
14
11
|
};
|
|
@@ -70,15 +67,6 @@ class SpeakerManager {
|
|
|
70
67
|
NativeManager.setForceSpeakerphoneOn(force);
|
|
71
68
|
};
|
|
72
69
|
}
|
|
73
|
-
const shouldBypassForCallKit = () => {
|
|
74
|
-
if (_reactNative.Platform.OS !== 'ios') {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
if (!CallingxModule) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
return CallingxModule.isSetup && (CallingxModule.hasRegisteredCall() || CallingxModule.isOngoingCallsEnabled);
|
|
81
|
-
};
|
|
82
70
|
class CallManager {
|
|
83
71
|
android = new AndroidCallManager();
|
|
84
72
|
ios = new IOSCallManager();
|
|
@@ -102,10 +90,6 @@ class CallManager {
|
|
|
102
90
|
* @param config.enableStereoAudioOutput Whether to enable stereo audio output. Only supported for listener audio role.
|
|
103
91
|
*/
|
|
104
92
|
start = config => {
|
|
105
|
-
if (shouldBypassForCallKit()) {
|
|
106
|
-
_videoClient.videoLoggerSystem.getLogger('CallManager').debug('start: skipping start as callkit is handling the audio session');
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
93
|
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
110
94
|
if (config?.audioRole === 'communicator') {
|
|
111
95
|
const type = config.deviceEndpointType ?? 'speaker';
|
|
@@ -121,10 +105,6 @@ class CallManager {
|
|
|
121
105
|
* Stops the in call manager.
|
|
122
106
|
*/
|
|
123
107
|
stop = () => {
|
|
124
|
-
if (shouldBypassForCallKit()) {
|
|
125
|
-
_videoClient.videoLoggerSystem.getLogger('CallManager').debug('stop: skipping stop as callkit is handling the audio session');
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
108
|
NativeManager.stop();
|
|
129
109
|
};
|
|
130
110
|
|
|
@@ -133,12 +113,6 @@ class CallManager {
|
|
|
133
113
|
* in the native layer.
|
|
134
114
|
*/
|
|
135
115
|
logAudioState = () => NativeManager.logAudioState();
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* For debugging purposes, returns the current audio state as a string.
|
|
139
|
-
* @returns A string containing the current audio state information.
|
|
140
|
-
*/
|
|
141
|
-
getAudioStateLog = () => NativeManager.getAudioStateLog();
|
|
142
116
|
}
|
|
143
117
|
exports.CallManager = CallManager;
|
|
144
118
|
//# sourceMappingURL=CallManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NativeManager","NativeModules","StreamInCallManager","invariant","condition","message","Error","AndroidCallManager","getAudioDeviceStatus","Platform","OS","selectAudioDevice","endpointName","chooseAudioDeviceEndpoint","addAudioDeviceChangeListener","onChange","eventEmitter","NativeEventEmitter","s","addListener","remove","IOSCallManager","showDeviceSelector","showAudioRoutePicker","SpeakerManager","setMute","mute","muteAudioOutput","unmuteAudioOutput","setForceSpeakerphoneOn","force","CallManager","android","ios","speaker","start","config","setAudioRole","audioRole","type","deviceEndpointType","setDefaultAudioDeviceEndpointType","enableStereoAudioOutput","setEnableStereoAudioOutput","stop","logAudioState","exports"],"sourceRoot":"../../../../src","sources":["modules/call-manager/CallManager.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,GAAGC,0BAAa,CAACC,mBAAmB;AAEvD,MAAMC,SAAS,GAAGA,CAACC,SAAkB,EAAEC,OAAe,KAAK;EACzD,IAAI,CAACD,SAAS,EAAE,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;AAC1C,CAAC;AAED,MAAME,kBAAkB,CAAC;EAGvB;AACF;AACA;EACEC,oBAAoB,GAAG,MAAAA,CAAA,KAAwC;IAC7DL,SAAS,CAACM,qBAAQ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G,IAAIzB,kBAAkB,CAAC,CAAC;EAClC0B,GAAG,GAAG,IAAIZ,cAAc,CAAC,CAAC;EAC1Ba,OAAO,GAAG,IAAIV,cAAc,CAAC,CAAC;;EAE9B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEW,KAAK,GAAIC,MAAkC,IAAW;IACpDpC,aAAa,CAACqC,YAAY,CAACD,MAAM,EAAEE,SAAS,IAAI,cAAc,CAAC;IAC/D,IAAIF,MAAM,EAAEE,SAAS,KAAK,cAAc,EAAE;MACxC,MAAMC,IAAI,GAAGH,MAAM,CAACI,kBAAkB,IAAI,SAAS;MACnDxC,aAAa,CAACyC,iCAAiC,CAACF,IAAI,CAAC;IACvD;IACA,IAAIH,MAAM,EAAEE,SAAS,KAAK,UAAU,IAAIF,MAAM,CAACM,uBAAuB,EAAE;MACtE1C,aAAa,CAAC2C,0BAA0B,CAAC,IAAI,CAAC;IAChD;IACA3C,aAAa,CAACmC,KAAK,CAAC,CAAC;EACvB,CAAC;;EAED;AACF;AACA;EACES,IAAI,GAAGA,CAAA,KAAY;IACjB5C,aAAa,CAAC4C,IAAI,CAAC,CAAC;EACtB,CAAC;;EAED;AACF;AACA;AACA;EACEC,aAAa,GAAGA,CAAA,KAAY7C,aAAa,CAAC6C,aAAa,CAAC,CAAC;AAC3D;AAACC,OAAA,CAAAf,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.StreamCall = void 0;
|
|
7
7
|
var _videoReactBindings = require("@stream-io/video-react-bindings");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useIosCallkeepWithCallingStateEffect = require("../../hooks/push/useIosCallkeepWithCallingStateEffect");
|
|
9
10
|
var _utils = require("../../utils/push/internal/utils");
|
|
10
11
|
var _useAndroidKeepCallAliveEffect = require("../../hooks/useAndroidKeepCallAliveEffect");
|
|
11
12
|
var _AppStateListener = require("./AppStateListener");
|
|
12
13
|
var _DeviceStats = require("./DeviceStats");
|
|
13
14
|
var _constants = require("../../utils/push/internal/constants");
|
|
14
|
-
var _useCallingExpWithCallingStateEffect = require("../../hooks/push/useCallingExpWithCallingStateEffect");
|
|
15
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
16
|
// const PIP_CHANGE_EVENT = 'StreamVideoReactNative_PIP_CHANGE_EVENT';
|
|
17
17
|
|
|
@@ -30,7 +30,7 @@ const StreamCall = ({
|
|
|
30
30
|
}) => {
|
|
31
31
|
return /*#__PURE__*/_react.default.createElement(_videoReactBindings.StreamCallProvider, {
|
|
32
32
|
call: call
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(_AppStateListener.AppStateListener, null), /*#__PURE__*/_react.default.createElement(AndroidKeepCallAlive, null), /*#__PURE__*/_react.default.createElement(
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_AppStateListener.AppStateListener, null), /*#__PURE__*/_react.default.createElement(AndroidKeepCallAlive, null), /*#__PURE__*/_react.default.createElement(IosInformCallkeepCallEnd, null), /*#__PURE__*/_react.default.createElement(ClearPushWSSubscriptions, null), /*#__PURE__*/_react.default.createElement(_DeviceStats.DeviceStats, null), children);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -44,11 +44,11 @@ const AndroidKeepCallAlive = () => {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* This is a renderless component to
|
|
48
|
-
*
|
|
47
|
+
* This is a renderless component to end the call in callkeep for ios.
|
|
48
|
+
* useAndroidKeepCallAliveEffect needs to called inside a child of StreamCallProvider.
|
|
49
49
|
*/
|
|
50
|
-
const
|
|
51
|
-
(0,
|
|
50
|
+
const IosInformCallkeepCallEnd = () => {
|
|
51
|
+
(0, _useIosCallkeepWithCallingStateEffect.useIosCallkeepWithCallingStateEffect)();
|
|
52
52
|
return null;
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_interopRequireWildcard","_utils","_useAndroidKeepCallAliveEffect","_AppStateListener","_DeviceStats","_constants","
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_interopRequireWildcard","_useIosCallkeepWithCallingStateEffect","_utils","_useAndroidKeepCallAliveEffect","_AppStateListener","_DeviceStats","_constants","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StreamCall","children","createElement","StreamCallProvider","AppStateListener","AndroidKeepCallAlive","IosInformCallkeepCallEnd","ClearPushWSSubscriptions","DeviceStats","exports","useAndroidKeepCallAliveEffect","useIosCallkeepWithCallingStateEffect","useEffect","pushUnsubscriptionCallbacks","forEach","cbArray","cb","clear","canAddPushWSSubscriptionsRef","current"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,qCAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,8BAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAAkF,SAAAE,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