rns-nativecall 1.3.6 → 1.3.8

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/ios/CallModule.m CHANGED
@@ -186,7 +186,6 @@ RCT_EXPORT_METHOD(checkCallStatus:(NSString *)uuidString
186
186
  }
187
187
  }
188
188
 
189
-
190
189
  - (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
191
190
  [action fulfill];
192
191
 
@@ -202,8 +201,6 @@ RCT_EXPORT_METHOD(checkCallStatus:(NSString *)uuidString
202
201
  });
203
202
  }
204
203
 
205
-
206
-
207
204
  - (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action {
208
205
  [action fulfill];
209
206
  self.isCallActive = NO;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rns-nativecall",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "High-performance React Native module for handling native VoIP call UI on Android and iOS.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -201,23 +201,32 @@ function withAndroidConfig(config) {
201
201
  function withIosAppDelegateMod(config) {
202
202
  return withAppDelegate(config, (config) => {
203
203
  let contents = config.modResults.contents;
204
+
205
+ // 1. Ensure RCTLinkingManager is imported if it's a Swift file
206
+ // Note: Expo 51+ uses Swift by default for AppDelegate
204
207
  if (!contents.includes('import React')) {
205
208
  contents = 'import React\n' + contents;
206
209
  }
207
210
 
211
+ // 2. Add the URL Scheme handler (Required for openURL to work)
212
+ if (!contents.includes('open url: URL')) {
213
+ const openUrlCode = `
214
+ override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
215
+ return RCTLinkingManager.application(app, open: url, options: options)
216
+ }`;
217
+ // Insert before the last closing brace
218
+ contents = contents.replace(/\n}\s*$/, `\n${openUrlCode}\n}`);
219
+ }
220
+
221
+ // 3. Keep your existing User Activity handler
208
222
  if (!contents.includes('continue userActivity')) {
209
- const swiftLinkingCode = `
210
- public override func application(
211
- _ application: UIApplication,
212
- continue userActivity: NSUserActivity,
213
- restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
214
- ) -> Bool {
215
- let result = RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
216
- return super.application(application, continue: userActivity, restorationHandler: restorationHandler) || result
217
- }
218
- `;
219
- contents = contents.replace(/\n}\s*$/, `\n${swiftLinkingCode}\n}`);
223
+ const userActivityCode = `
224
+ override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
225
+ return RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
226
+ }`;
227
+ contents = contents.replace(/\n}\s*$/, `\n${userActivityCode}\n}`);
220
228
  }
229
+
221
230
  config.modResults.contents = contents;
222
231
  return config;
223
232
  });
@@ -226,16 +235,29 @@ function withIosAppDelegateMod(config) {
226
235
  function withIosConfig(config, props = {}) {
227
236
  return withInfoPlist(config, (config) => {
228
237
  const infoPlist = config.modResults;
238
+
239
+ // 1. Existing Background Modes
229
240
  if (!infoPlist.UIBackgroundModes) infoPlist.UIBackgroundModes = [];
230
241
  ['voip', 'remote-notification'].forEach(mode => {
231
242
  if (!infoPlist.UIBackgroundModes.includes(mode)) {
232
243
  infoPlist.UIBackgroundModes.push(mode);
233
244
  }
234
245
  });
246
+
247
+ // 2. 🔑 The Fix for the Error: Whitelist the scheme
248
+ const scheme = config.scheme || 'dorm'; // fallback to raiidr
249
+ if (!infoPlist.LSApplicationQueriesSchemes) {
250
+ infoPlist.LSApplicationQueriesSchemes = [];
251
+ }
252
+ if (!infoPlist.LSApplicationQueriesSchemes.includes(scheme)) {
253
+ infoPlist.LSApplicationQueriesSchemes.push(scheme);
254
+ }
255
+
235
256
  return config;
236
257
  });
237
258
  }
238
259
 
260
+
239
261
  module.exports = (config, props) => {
240
262
  return withPlugins(config, [
241
263
  withAndroidConfig,