@stream-io/video-react-native-sdk 1.30.0 → 1.30.1-beta.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/android/src/main/AndroidManifest.xml +8 -1
- package/android/src/main/AndroidManifestNew.xml +11 -0
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +42 -5
- package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +70 -6
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +6 -4
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +83 -0
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +149 -0
- package/dist/commonjs/hooks/push/index.js +0 -2
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +121 -0
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +64 -97
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +26 -0
- 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 +33 -21
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +68 -0
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +1 -0
- package/dist/commonjs/utils/internal/callingx/callingx.js +123 -0
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +52 -3
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +48 -0
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +1 -0
- package/dist/commonjs/utils/push/android.js +135 -202
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +17 -34
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +1 -45
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +67 -52
- 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/callingx.js +78 -0
- package/dist/commonjs/utils/push/libs/callingx.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +8 -19
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +0 -19
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +105 -0
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +7 -6
- 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/hooks/push/index.js +0 -2
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +114 -0
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +18 -31
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +66 -99
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +26 -0
- 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 +33 -21
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +61 -0
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +1 -0
- package/dist/module/utils/internal/callingx/callingx.js +114 -0
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +52 -3
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +42 -0
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +1 -0
- package/dist/module/utils/push/android.js +137 -204
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +17 -34
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +0 -44
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +63 -49
- 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/callingx.js +70 -0
- package/dist/module/utils/push/libs/callingx.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +1 -2
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +0 -18
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +99 -0
- package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +7 -6
- 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/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +1 -0
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +5 -0
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +20 -2
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +63 -25
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +16 -0
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +1 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +17 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +10 -0
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +1 -0
- package/dist/typescript/utils/push/android.d.ts +1 -2
- 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 +0 -33
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +14 -8
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +1 -2
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +9 -0
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/index.d.ts +1 -2
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +8 -0
- package/dist/typescript/utils/push/setupCallingExpEvents.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 +1 -33
- package/expo-config-plugin/dist/withAndroidPermissions.js +2 -7
- package/expo-config-plugin/dist/withAppDelegate.js +19 -197
- package/expo-config-plugin/dist/withMainActivity.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +2 -3
- package/ios/StreamInCallManager.m +2 -0
- package/ios/StreamInCallManager.swift +19 -7
- package/ios/StreamVideoReactNative.h +7 -4
- package/ios/StreamVideoReactNative.m +189 -82
- package/package.json +13 -18
- package/src/hooks/push/index.ts +0 -2
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +147 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +21 -34
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +94 -120
- package/src/index.ts +1 -0
- package/src/modules/call-manager/CallManager.ts +36 -0
- package/src/modules/call-manager/native-module.d.ts +7 -0
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +40 -30
- package/src/utils/StreamVideoRN/types.ts +65 -25
- package/src/utils/internal/callingx/audioSessionPromise.ts +65 -0
- package/src/utils/internal/callingx/callingx.ts +165 -0
- package/src/utils/internal/registerSDKGlobals.ts +47 -4
- package/src/utils/keepCallAliveHeadlessTask.ts +54 -0
- package/src/utils/push/android.ts +196 -311
- package/src/utils/push/internal/ios.ts +28 -44
- package/src/utils/push/internal/rxSubjects.ts +0 -61
- package/src/utils/push/internal/utils.ts +104 -63
- package/src/utils/push/ios.ts +1 -6
- package/src/utils/push/libs/callingx.ts +93 -0
- package/src/utils/push/libs/index.ts +1 -2
- package/src/utils/push/libs/notifee/index.ts +0 -27
- package/src/utils/push/setupCallingExpEvents.ts +135 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +11 -7
- package/src/version.ts +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +0 -95
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -160
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +0 -67
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +0 -17
- package/dist/commonjs/utils/push/libs/callkeep.js.map +0 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +0 -17
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +0 -1
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +0 -205
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +0 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +0 -153
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +0 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +0 -60
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +0 -1
- package/dist/module/utils/push/libs/callkeep.js +0 -11
- package/dist/module/utils/push/libs/callkeep.js.map +0 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +0 -11
- package/dist/module/utils/push/libs/voipPushNotification.js.map +0 -1
- package/dist/module/utils/push/setupIosCallKeepEvents.js +0 -199
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +0 -8
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +0 -3
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +0 -3
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +0 -6
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +0 -1
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +0 -235
- package/src/hooks/push/useProcessPushCallEffect.ts +0 -108
- package/src/utils/push/libs/callkeep.ts +0 -16
- package/src/utils/push/libs/voipPushNotification.ts +0 -17
- package/src/utils/push/setupIosCallKeepEvents.ts +0 -252
|
@@ -9,7 +9,7 @@ const addNewLinesToAppDelegateObjc_1 = __importDefault(require("./common/addNewL
|
|
|
9
9
|
const addToSwiftBridgingHeaderFile_1 = require("./common/addToSwiftBridgingHeaderFile");
|
|
10
10
|
const withAppDelegate = (configuration, props) => {
|
|
11
11
|
return (0, config_plugins_1.withAppDelegate)(configuration, (config) => {
|
|
12
|
-
if (!props?.
|
|
12
|
+
if (!props?.ringing &&
|
|
13
13
|
!props?.iOSEnableMultitaskingCameraAccess &&
|
|
14
14
|
!props?.addNoiseCancellation) {
|
|
15
15
|
// quit early if no change is necessary
|
|
@@ -21,19 +21,12 @@ const withAppDelegate = (configuration, props) => {
|
|
|
21
21
|
config.modResults.contents = (0, codeMod_1.addObjcImports)(config.modResults.contents, ['"NoiseCancellationManagerObjc.h"']);
|
|
22
22
|
}
|
|
23
23
|
config.modResults.contents = addDidFinishLaunchingWithOptionsObjc(config.modResults.contents, props.iOSEnableMultitaskingCameraAccess, props.addNoiseCancellation);
|
|
24
|
-
if (props?.
|
|
25
|
-
config.modResults.contents = (0, codeMod_1.addObjcImports)(config.modResults.contents, [
|
|
26
|
-
'"RNCallKeep.h"',
|
|
27
|
-
'<PushKit/PushKit.h>',
|
|
28
|
-
'"RNVoipPushNotificationManager.h"',
|
|
29
|
-
'"StreamVideoReactNative.h"',
|
|
30
|
-
'<WebRTC/RTCAudioSession.h>',
|
|
31
|
-
]);
|
|
24
|
+
if (props?.ringing) {
|
|
25
|
+
config.modResults.contents = (0, codeMod_1.addObjcImports)(config.modResults.contents, ['<PushKit/PushKit.h>', '"StreamVideoReactNative.h"']);
|
|
32
26
|
config.modResults.contents =
|
|
33
|
-
addDidFinishLaunchingWithOptionsRingingObjc(config.modResults.contents
|
|
27
|
+
addDidFinishLaunchingWithOptionsRingingObjc(config.modResults.contents);
|
|
34
28
|
config.modResults.contents = addDidUpdatePushCredentialsObjc(config.modResults.contents);
|
|
35
29
|
config.modResults.contents = addDidReceiveIncomingPushCallbackObjc(config.modResults.contents);
|
|
36
|
-
config.modResults.contents = addAudioSessionMethodsObjc(config.modResults.contents);
|
|
37
30
|
}
|
|
38
31
|
return config;
|
|
39
32
|
}
|
|
@@ -43,7 +36,7 @@ const withAppDelegate = (configuration, props) => {
|
|
|
43
36
|
}
|
|
44
37
|
else {
|
|
45
38
|
try {
|
|
46
|
-
if (props?.
|
|
39
|
+
if (props?.ringing) {
|
|
47
40
|
// make it public class AppDelegate: ExpoAppDelegate, PKPushRegistryDelegate {
|
|
48
41
|
const regex = /(class\s+AppDelegate[^{]*)(\s*\{)/;
|
|
49
42
|
config.modResults.contents = config.modResults.contents.replace(regex, (match, declarationPart, openBrace) => {
|
|
@@ -76,13 +69,12 @@ const withAppDelegate = (configuration, props) => {
|
|
|
76
69
|
config.modResults.contents = (0, codeMod_1.addSwiftImports)(config.modResults.contents, ['stream_io_noise_cancellation_react_native']);
|
|
77
70
|
}
|
|
78
71
|
config.modResults.contents = addDidFinishLaunchingWithOptionsSwift(config.modResults.contents, props.iOSEnableMultitaskingCameraAccess, props.addNoiseCancellation);
|
|
79
|
-
if (props?.
|
|
80
|
-
config.modResults.contents = (0, codeMod_1.addSwiftImports)(config.modResults.contents, ['
|
|
72
|
+
if (props?.ringing) {
|
|
73
|
+
config.modResults.contents = (0, codeMod_1.addSwiftImports)(config.modResults.contents, ['PushKit', 'stream_video_react_native']);
|
|
81
74
|
config.modResults.contents =
|
|
82
|
-
addDidFinishLaunchingWithOptionsRingingSwift(config.modResults.contents
|
|
75
|
+
addDidFinishLaunchingWithOptionsRingingSwift(config.modResults.contents);
|
|
83
76
|
config.modResults.contents = addDidUpdatePushCredentialsSwift(config.modResults.contents);
|
|
84
77
|
config.modResults.contents = addDidReceiveIncomingPushCallbackSwift(config.modResults.contents);
|
|
85
|
-
config.modResults.contents = addAudioSessionMethodsSwift(config.modResults.contents);
|
|
86
78
|
}
|
|
87
79
|
return config;
|
|
88
80
|
}
|
|
@@ -127,55 +119,26 @@ function addDidFinishLaunchingWithOptionsObjc(contents, iOSEnableMultitaskingCam
|
|
|
127
119
|
}
|
|
128
120
|
return contents;
|
|
129
121
|
}
|
|
130
|
-
function addDidFinishLaunchingWithOptionsRingingSwift(contents
|
|
122
|
+
function addDidFinishLaunchingWithOptionsRingingSwift(contents) {
|
|
131
123
|
const functionSelector = 'application(_:didFinishLaunchingWithOptions:)';
|
|
132
|
-
const supportsVideoString = ringingPushNotifications.disableVideoIos
|
|
133
|
-
? 'false'
|
|
134
|
-
: 'true';
|
|
135
|
-
const includesCallsInRecents = ringingPushNotifications.includesCallsInRecentsIos ? 'false' : 'true';
|
|
136
|
-
const setupCallKeep = ` let localizedAppName = Bundle.main.localizedInfoDictionary?["CFBundleDisplayName"] as? String
|
|
137
|
-
let appName = Bundle.main.infoDictionary?["CFBundleDisplayName"] as? String
|
|
138
|
-
RNCallKeep.setup([
|
|
139
|
-
"appName": localizedAppName != nil ? localizedAppName! : appName as Any,
|
|
140
|
-
"supportsVideo": ${supportsVideoString},
|
|
141
|
-
"includesCallsInRecents": ${includesCallsInRecents},
|
|
142
|
-
])`;
|
|
143
|
-
if (!contents.includes('RNCallKeep.setup')) {
|
|
144
|
-
contents = (0, codeMod_1.insertContentsInsideSwiftFunctionBlock)(contents, functionSelector, setupCallKeep, { position: 'head' });
|
|
145
|
-
}
|
|
146
124
|
// call the setup of voip push notification
|
|
147
|
-
const voipSetupMethod = '
|
|
125
|
+
const voipSetupMethod = 'StreamVideoReactNative.voipRegistration()';
|
|
148
126
|
if (!contents.includes(voipSetupMethod)) {
|
|
149
127
|
contents = (0, codeMod_1.insertContentsInsideSwiftFunctionBlock)(contents, functionSelector, ' ' /* indentation */ + voipSetupMethod, { position: 'head' });
|
|
150
128
|
}
|
|
151
129
|
return contents;
|
|
152
130
|
}
|
|
153
|
-
function addDidFinishLaunchingWithOptionsRingingObjc(contents
|
|
131
|
+
function addDidFinishLaunchingWithOptionsRingingObjc(contents) {
|
|
154
132
|
const functionSelector = 'application:didFinishLaunchingWithOptions:';
|
|
155
|
-
// call the setup RNCallKeep
|
|
156
|
-
const supportsVideoString = ringingPushNotifications.disableVideoIos
|
|
157
|
-
? '@NO'
|
|
158
|
-
: '@YES';
|
|
159
|
-
const includesCallsInRecents = ringingPushNotifications.includesCallsInRecentsIos ? '@YES' : '@NO';
|
|
160
|
-
const setupCallKeep = `NSString *localizedAppName = [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:@"CFBundleDisplayName"];
|
|
161
|
-
NSString *appName = [[[NSBundle mainBundle] infoDictionary]objectForKey :@"CFBundleDisplayName"];
|
|
162
|
-
[RNCallKeep setup:@{
|
|
163
|
-
@"appName": localizedAppName != nil ? localizedAppName : appName,
|
|
164
|
-
@"supportsVideo": ${supportsVideoString},
|
|
165
|
-
@"includesCallsInRecents": ${includesCallsInRecents},
|
|
166
|
-
}];`;
|
|
167
|
-
if (!contents.includes('[RNCallKeep setup:@')) {
|
|
168
|
-
contents = (0, codeMod_1.insertContentsInsideObjcFunctionBlock)(contents, functionSelector, setupCallKeep, { position: 'head' });
|
|
169
|
-
}
|
|
170
133
|
// call the setup of voip push notification
|
|
171
|
-
const voipSetupMethod = '[
|
|
134
|
+
const voipSetupMethod = '[StreamVideoReactNative voipRegistration];';
|
|
172
135
|
if (!contents.includes(voipSetupMethod)) {
|
|
173
136
|
contents = (0, codeMod_1.insertContentsInsideObjcFunctionBlock)(contents, functionSelector, voipSetupMethod, { position: 'head' });
|
|
174
137
|
}
|
|
175
138
|
return contents;
|
|
176
139
|
}
|
|
177
140
|
function addDidUpdatePushCredentialsSwift(contents) {
|
|
178
|
-
const updatedPushCredentialsMethod = '
|
|
141
|
+
const updatedPushCredentialsMethod = 'StreamVideoReactNative.didUpdate(credentials, forType: type.rawValue)';
|
|
179
142
|
if (!contents.includes(updatedPushCredentialsMethod)) {
|
|
180
143
|
const functionSelector = 'pushRegistry(_:didUpdate:for:)';
|
|
181
144
|
const codeblock = (0, codeMod_1.findSwiftFunctionCodeBlock)(contents, functionSelector);
|
|
@@ -197,7 +160,7 @@ function addDidUpdatePushCredentialsSwift(contents) {
|
|
|
197
160
|
return contents;
|
|
198
161
|
}
|
|
199
162
|
function addDidUpdatePushCredentialsObjc(contents) {
|
|
200
|
-
const updatedPushCredentialsMethod = '[
|
|
163
|
+
const updatedPushCredentialsMethod = '[StreamVideoReactNative didUpdatePushCredentials:credentials forType: (NSString *) type];';
|
|
201
164
|
if (!contents.includes(updatedPushCredentialsMethod)) {
|
|
202
165
|
const functionSelector = 'pushRegistry:didUpdatePushCredentials:forType:';
|
|
203
166
|
const codeblock = (0, codeMod_1.findObjcFunctionCodeBlock)(contents, functionSelector);
|
|
@@ -214,112 +177,10 @@ function addDidUpdatePushCredentialsObjc(contents) {
|
|
|
214
177
|
}
|
|
215
178
|
return contents;
|
|
216
179
|
}
|
|
217
|
-
function addAudioSessionMethodsSwift(contents) {
|
|
218
|
-
const audioSessionDidActivateMethod = 'RTCAudioSession.sharedInstance().audioSessionDidActivate(AVAudioSession.sharedInstance())';
|
|
219
|
-
if (!contents.includes(audioSessionDidActivateMethod)) {
|
|
220
|
-
const functionSelector = 'provider(_:didActivate:)';
|
|
221
|
-
if (!contents.includes('didActivateAudioSession')) {
|
|
222
|
-
contents = (0, codeMod_1.insertContentsInsideSwiftClassBlock)(contents, 'class AppDelegate', `
|
|
223
|
-
func provider(_ provider: CXProvider, didActivateAudioSession audioSession: AVAudioSession) {
|
|
224
|
-
${audioSessionDidActivateMethod}
|
|
225
|
-
}
|
|
226
|
-
`, { position: 'tail' });
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
contents = (0, codeMod_1.insertContentsInsideSwiftFunctionBlock)(contents, functionSelector, audioSessionDidActivateMethod, { position: 'tail' });
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
const audioSessionDidDeactivateMethod = 'RTCAudioSession.sharedInstance().audioSessionDidDeactivate(AVAudioSession.sharedInstance())';
|
|
233
|
-
if (!contents.includes(audioSessionDidDeactivateMethod)) {
|
|
234
|
-
const functionSelector = 'provider(_:didDeactivate:)';
|
|
235
|
-
if (!contents.includes('didDeactivateAudioSession')) {
|
|
236
|
-
contents = (0, codeMod_1.insertContentsInsideSwiftClassBlock)(contents, 'class AppDelegate', `
|
|
237
|
-
func provider(_ provider: CXProvider, didDeactivateAudioSession audioSession: AVAudioSession) {
|
|
238
|
-
${audioSessionDidDeactivateMethod}
|
|
239
|
-
}
|
|
240
|
-
`, { position: 'tail' });
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
contents = (0, codeMod_1.insertContentsInsideSwiftFunctionBlock)(contents, functionSelector, audioSessionDidDeactivateMethod, { position: 'tail' });
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return contents;
|
|
247
|
-
}
|
|
248
|
-
function addAudioSessionMethodsObjc(contents) {
|
|
249
|
-
const audioSessionDidActivateMethod = '[[RTCAudioSession sharedInstance] audioSessionDidActivate:[AVAudioSession sharedInstance]];';
|
|
250
|
-
if (!contents.includes(audioSessionDidActivateMethod)) {
|
|
251
|
-
const functionSelector = 'provider:didActivateAudioSession:audioSession:';
|
|
252
|
-
const codeblock = (0, codeMod_1.findObjcFunctionCodeBlock)(contents, functionSelector);
|
|
253
|
-
if (!codeblock) {
|
|
254
|
-
contents = (0, addNewLinesToAppDelegateObjc_1.default)(contents, [
|
|
255
|
-
'- (void) provider:(CXProvider *) provider didActivateAudioSession:(AVAudioSession *) audioSession {',
|
|
256
|
-
' ' /* indentation */ + audioSessionDidActivateMethod,
|
|
257
|
-
'}',
|
|
258
|
-
]);
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
contents = (0, codeMod_1.insertContentsInsideObjcFunctionBlock)(contents, functionSelector, audioSessionDidActivateMethod, { position: 'tail' });
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const audioSessionDidDeactivateMethod = '[[RTCAudioSession sharedInstance] audioSessionDidDeactivate:[AVAudioSession sharedInstance]];';
|
|
265
|
-
if (!contents.includes(audioSessionDidDeactivateMethod)) {
|
|
266
|
-
const functionSelector = 'provider:didDeactivateAudioSession:audioSession:';
|
|
267
|
-
const codeblock = (0, codeMod_1.findObjcFunctionCodeBlock)(contents, functionSelector);
|
|
268
|
-
if (!codeblock) {
|
|
269
|
-
contents = (0, addNewLinesToAppDelegateObjc_1.default)(contents, [
|
|
270
|
-
'- (void) provider:(CXProvider *) provider didDeactivateAudioSession:(AVAudioSession *) audioSession {',
|
|
271
|
-
' ' /* indentation */ + audioSessionDidDeactivateMethod,
|
|
272
|
-
'}',
|
|
273
|
-
]);
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
contents = (0, codeMod_1.insertContentsInsideObjcFunctionBlock)(contents, functionSelector, audioSessionDidDeactivateMethod, { position: 'tail' });
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return contents;
|
|
280
|
-
}
|
|
281
180
|
function addDidReceiveIncomingPushCallbackSwift(contents) {
|
|
282
181
|
const onIncomingPush = `
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
let cid = stream["call_cid"] as? String else {
|
|
286
|
-
completion()
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// Check if user is busy BEFORE registering the call
|
|
291
|
-
let shouldReject = StreamVideoReactNative.shouldRejectCallWhenBusy()
|
|
292
|
-
let hasAnyActiveCall = StreamVideoReactNative.hasAnyActiveCall()
|
|
293
|
-
|
|
294
|
-
if shouldReject && hasAnyActiveCall {
|
|
295
|
-
// Complete the VoIP notification without showing CallKit UI
|
|
296
|
-
completion()
|
|
297
|
-
return
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
let uuid = UUID().uuidString
|
|
301
|
-
let videoIncluded = stream["video"] as? String
|
|
302
|
-
let hasVideo = videoIncluded == "false" ? false : true
|
|
303
|
-
|
|
304
|
-
StreamVideoReactNative.registerIncomingCall(cid, uuid: uuid)
|
|
305
|
-
|
|
306
|
-
RNVoipPushNotificationManager.addCompletionHandler(uuid, completionHandler: completion)
|
|
307
|
-
|
|
308
|
-
RNVoipPushNotificationManager.didReceiveIncomingPush(with: payload, forType: type.rawValue)
|
|
309
|
-
|
|
310
|
-
RNCallKeep.reportNewIncomingCall(uuid,
|
|
311
|
-
handle: createdCallerName,
|
|
312
|
-
handleType: "generic",
|
|
313
|
-
hasVideo: hasVideo,
|
|
314
|
-
localizedCallerName: createdCallerName,
|
|
315
|
-
supportsHolding: false,
|
|
316
|
-
supportsDTMF: false,
|
|
317
|
-
supportsGrouping: false,
|
|
318
|
-
supportsUngrouping: false,
|
|
319
|
-
fromPushKit: true,
|
|
320
|
-
payload: stream,
|
|
321
|
-
withCompletionHandler: nil)`;
|
|
322
|
-
if (!contents.includes('RNVoipPushNotificationManager.didReceiveIncomingPush')) {
|
|
182
|
+
StreamVideoReactNative.didReceiveIncomingPush(payload, forType: type.rawValue, completionHandler: completion)`;
|
|
183
|
+
if (!contents.includes('StreamVideoReactNative.didReceiveIncomingPush')) {
|
|
323
184
|
const functionSelector = 'pushRegistry(_:didReceiveIncomingPushWith:for:completion:)';
|
|
324
185
|
const codeblock = (0, codeMod_1.findSwiftFunctionCodeBlock)(contents, functionSelector);
|
|
325
186
|
if (!codeblock) {
|
|
@@ -342,49 +203,10 @@ function addDidReceiveIncomingPushCallbackSwift(contents) {
|
|
|
342
203
|
}
|
|
343
204
|
function addDidReceiveIncomingPushCallbackObjc(contents) {
|
|
344
205
|
const onIncomingPush = `
|
|
345
|
-
// process the payload and
|
|
346
|
-
|
|
347
|
-
NSString *uuid = [[NSUUID UUID] UUIDString];
|
|
348
|
-
NSString *createdCallerName = stream[@"created_by_display_name"];
|
|
349
|
-
NSString *cid = stream[@"call_cid"];
|
|
350
|
-
|
|
351
|
-
// Check if user is busy BEFORE registering the call
|
|
352
|
-
BOOL shouldReject = [StreamVideoReactNative shouldRejectCallWhenBusy];
|
|
353
|
-
BOOL hasAnyActiveCall = [StreamVideoReactNative hasAnyActiveCall];
|
|
354
|
-
|
|
355
|
-
if (shouldReject && hasAnyActiveCall) {
|
|
356
|
-
// Complete the VoIP notification without showing CallKit UI
|
|
357
|
-
completion();
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
NSString *videoIncluded = stream[@"video"];
|
|
362
|
-
BOOL hasVideo = [videoIncluded isEqualToString:@"false"] ? NO : YES;
|
|
363
|
-
|
|
364
|
-
// store the call cid and uuid in the native module's cache
|
|
365
|
-
[StreamVideoReactNative registerIncomingCall:cid uuid:uuid];
|
|
366
|
-
|
|
367
|
-
// set the completion handler - this one is called by the JS SDK
|
|
368
|
-
[RNVoipPushNotificationManager addCompletionHandler:uuid completionHandler:completion];
|
|
369
|
-
|
|
370
|
-
// send event to JS - the JS SDK will handle the rest and call the 'completionHandler'
|
|
371
|
-
[RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
|
|
372
|
-
|
|
373
|
-
// display the incoming call notification
|
|
374
|
-
[RNCallKeep reportNewIncomingCall: uuid
|
|
375
|
-
handle: createdCallerName
|
|
376
|
-
handleType: @"generic"
|
|
377
|
-
hasVideo: hasVideo
|
|
378
|
-
localizedCallerName: createdCallerName
|
|
379
|
-
supportsHolding: NO
|
|
380
|
-
supportsDTMF: NO
|
|
381
|
-
supportsGrouping: NO
|
|
382
|
-
supportsUngrouping: NO
|
|
383
|
-
fromPushKit: YES
|
|
384
|
-
payload: stream
|
|
385
|
-
withCompletionHandler: nil];
|
|
206
|
+
// process the payload and display the incoming call notification
|
|
207
|
+
[StreamVideoReactNative didReceiveIncomingPush:payload forType: (NSString *)type completionHandler:completion];
|
|
386
208
|
`;
|
|
387
|
-
if (!contents.includes('[
|
|
209
|
+
if (!contents.includes('[StreamVideoReactNative didReceiveIncomingPush')) {
|
|
388
210
|
const functionSelector = 'pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:';
|
|
389
211
|
const codeblock = (0, codeMod_1.findObjcFunctionCodeBlock)(contents, functionSelector);
|
|
390
212
|
if (!codeblock) {
|
|
@@ -23,7 +23,7 @@ const withStreamVideoReactNativeSDKMainActivity = (configuration, props) => {
|
|
|
23
23
|
if (props?.enableScreenshare) {
|
|
24
24
|
config.modResults.contents = addInsideOnCreateScreenshare(config.modResults.contents, isMainActivityJava);
|
|
25
25
|
}
|
|
26
|
-
if (props?.
|
|
26
|
+
if (props?.ringing) {
|
|
27
27
|
config.modResults.contents = addInsideOnCreateLockscreen(config.modResults.contents, isMainActivityJava);
|
|
28
28
|
}
|
|
29
29
|
return config;
|
|
@@ -12,7 +12,7 @@ const withStreamVideoReactNativeSDKiOSInfoPList = (configuration, props) => {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
addBackgroundMode('audio');
|
|
15
|
-
if (props?.
|
|
15
|
+
if (props?.ringing) {
|
|
16
16
|
addBackgroundMode('voip');
|
|
17
17
|
addBackgroundMode('fetch');
|
|
18
18
|
addBackgroundMode('processing');
|
|
@@ -20,8 +20,7 @@ const withStreamVideoReactNativeSDKiOSInfoPList = (configuration, props) => {
|
|
|
20
20
|
'$(PRODUCT_BUNDLE_IDENTIFIER)',
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
|
-
if (props?.enableNonRingingPushNotifications ||
|
|
24
|
-
props?.ringingPushNotifications) {
|
|
23
|
+
if (props?.enableNonRingingPushNotifications || props?.ringing) {
|
|
25
24
|
addBackgroundMode('remote-notification');
|
|
26
25
|
}
|
|
27
26
|
return config;
|
|
@@ -116,7 +116,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
116
116
|
}
|
|
117
117
|
} else {
|
|
118
118
|
intendedCategory = .playAndRecord
|
|
119
|
-
intendedMode =
|
|
119
|
+
intendedMode = .voiceChat
|
|
120
120
|
|
|
121
121
|
// XCode 16 and older don't expose .allowBluetoothHFP
|
|
122
122
|
// https://forums.swift.org/t/xcode-26-avaudiosession-categoryoptions-allowbluetooth-deprecated/80956
|
|
@@ -132,6 +132,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
132
132
|
rtcConfig.category = intendedCategory.rawValue
|
|
133
133
|
rtcConfig.mode = intendedMode.rawValue
|
|
134
134
|
rtcConfig.categoryOptions = intendedOptions
|
|
135
|
+
// This ensures WebRTC's internal state stays consistent during interruptions/route changes
|
|
135
136
|
RTCAudioSessionConfiguration.setWebRTC(rtcConfig)
|
|
136
137
|
|
|
137
138
|
let session = RTCAudioSession.sharedInstance()
|
|
@@ -140,7 +141,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
140
141
|
session.unlockForConfiguration()
|
|
141
142
|
}
|
|
142
143
|
do {
|
|
143
|
-
try session.
|
|
144
|
+
try session.setConfiguration(rtcConfig)
|
|
144
145
|
if (wasRecording) {
|
|
145
146
|
try adm.setRecording(wasRecording)
|
|
146
147
|
}
|
|
@@ -266,6 +267,11 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
266
267
|
|
|
267
268
|
@objc
|
|
268
269
|
func logAudioState() {
|
|
270
|
+
log(getAudioStateLog())
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@objc(getAudioStateLog)
|
|
274
|
+
func getAudioStateLog() -> String {
|
|
269
275
|
let session = AVAudioSession.sharedInstance()
|
|
270
276
|
let adm = getAudioDeviceModule()
|
|
271
277
|
|
|
@@ -278,7 +284,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
278
284
|
|
|
279
285
|
let rtcAVSession = rtcSession.session
|
|
280
286
|
let logString = """
|
|
281
|
-
|
|
287
|
+
AVAudioSession State:
|
|
282
288
|
Category: \(session.category.rawValue)
|
|
283
289
|
Mode: \(session.mode.rawValue)
|
|
284
290
|
Output Port: \(session.currentRoute.outputs.first?.portName ?? "N/A")
|
|
@@ -286,10 +292,16 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
286
292
|
Category Options: \(session.categoryOptions)
|
|
287
293
|
InputNumberOfChannels: \(session.inputNumberOfChannels)
|
|
288
294
|
OutputNumberOfChannels: \(session.outputNumberOfChannels)
|
|
289
|
-
|
|
290
|
-
|
|
295
|
+
|
|
296
|
+
AudioDeviceModule State:
|
|
297
|
+
IsPlaying: \(adm.isPlaying)
|
|
298
|
+
IsRecording: \(adm.isRecording)
|
|
299
|
+
IsVoiceProcessingAGCEnabled: \(adm.isVoiceProcessingAGCEnabled)
|
|
300
|
+
IsVoiceProcessingBypassed: \(adm.isVoiceProcessingBypassed)
|
|
301
|
+
IsVoiceProcessingEnabled: \(adm.isVoiceProcessingEnabled)
|
|
302
|
+
IsStereoPlayoutEnabled: \(adm.isStereoPlayoutEnabled)
|
|
291
303
|
|
|
292
|
-
|
|
304
|
+
RTCAudioSession State:
|
|
293
305
|
Wrapped Category: \(rtcAVSession.category.rawValue)
|
|
294
306
|
Wrapped Mode: \(rtcAVSession.mode.rawValue)
|
|
295
307
|
Wrapped Output Port: \(rtcAVSession.currentRoute.outputs.first?.portName ?? "N/A")
|
|
@@ -300,7 +312,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
300
312
|
IsActive: \(rtcSession.isActive)
|
|
301
313
|
ActivationCount: \(rtcSession.activationCount)
|
|
302
314
|
"""
|
|
303
|
-
|
|
315
|
+
return logString
|
|
304
316
|
}
|
|
305
317
|
|
|
306
318
|
@objc(muteAudioOutput)
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
#import <React/RCTEventEmitter.h>
|
|
2
2
|
#import <React/RCTBridge.h>
|
|
3
|
+
#import <PushKit/PushKit.h>
|
|
3
4
|
|
|
4
5
|
@interface StreamVideoReactNative : RCTEventEmitter <RCTBridgeModule>
|
|
5
6
|
|
|
6
7
|
- (void)screenShareEventReceived:(NSString *)event;
|
|
7
8
|
|
|
8
|
-
+ (void)registerIncomingCall:(NSString *)cid uuid:(NSString *)uuid;
|
|
9
|
-
|
|
10
9
|
+ (void)setup DEPRECATED_MSG_ATTRIBUTE("No need to use setup() anymore");
|
|
11
10
|
|
|
12
|
-
+ (BOOL)shouldRejectCallWhenBusy;
|
|
13
|
-
|
|
14
11
|
+ (BOOL)hasAnyActiveCall;
|
|
15
12
|
|
|
13
|
+
+ (void)voipRegistration;
|
|
14
|
+
|
|
15
|
+
+ (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type;
|
|
16
|
+
|
|
17
|
+
+ (void)didReceiveIncomingPush:(PKPushPayload *)payload forType:(NSString *)type completionHandler: (void (^_Nullable)(void)) completion;
|
|
18
|
+
|
|
16
19
|
@end
|