rns-nativecall 0.8.8 → 0.9.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/ios/CallModule.h +1 -1
- package/package.json +1 -1
- package/rns-nativecall.podspec +6 -2
- package/withNativeCallVoip.js +15 -10
package/ios/CallModule.h
CHANGED
package/package.json
CHANGED
package/rns-nativecall.podspec
CHANGED
|
@@ -9,12 +9,16 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.homepage = package["homepage"]
|
|
10
10
|
s.license = package["license"]
|
|
11
11
|
s.authors = package["author"]
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
# UPDATE: Move this to 13.0 or at least 12.0.
|
|
14
|
+
# iOS 13 is required for the SceneDelegate/Window logic we wrote.
|
|
15
|
+
s.platforms = { :ios => "13.0" }
|
|
16
|
+
|
|
13
17
|
s.source = { :git => "https://github.com/raiidr.git", :tag => "#{s.version}" }
|
|
14
18
|
|
|
15
19
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
16
20
|
|
|
17
|
-
#
|
|
21
|
+
# These ensure the native compiler links the correct Apple libraries
|
|
18
22
|
s.frameworks = "CallKit", "AVFoundation"
|
|
19
23
|
|
|
20
24
|
s.dependency "React-Core"
|
package/withNativeCallVoip.js
CHANGED
|
@@ -157,13 +157,15 @@ function withIosAppDelegateMod(config) {
|
|
|
157
157
|
return withAppDelegate(config, (config) => {
|
|
158
158
|
let contents = config.modResults.contents;
|
|
159
159
|
|
|
160
|
-
// 1.
|
|
160
|
+
// 1. Check for the import
|
|
161
161
|
if (!contents.includes('#import <React/RCTLinkingManager.h>')) {
|
|
162
162
|
contents = '#import <React/RCTLinkingManager.h>\n' + contents;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
// 2.
|
|
166
|
-
|
|
165
|
+
// 2. Only inject if the method name doesn't exist AT ALL
|
|
166
|
+
// This prevents the "Duplicate Method" error
|
|
167
|
+
if (!contents.includes('continueUserActivity')) {
|
|
168
|
+
const linkingCode = `
|
|
167
169
|
- (BOOL)application:(UIApplication *)application
|
|
168
170
|
continueUserActivity:(NSUserActivity *)userActivity
|
|
169
171
|
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
|
|
@@ -173,17 +175,22 @@ function withIosAppDelegateMod(config) {
|
|
|
173
175
|
restorationHandler:restorationHandler];
|
|
174
176
|
}
|
|
175
177
|
`;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
contents =
|
|
178
|
+
// Inject before the LAST @end in the file
|
|
179
|
+
const parts = contents.split('@end');
|
|
180
|
+
const lastPart = parts.pop();
|
|
181
|
+
contents = parts.join('@end') + linkingCode + '\n@end' + lastPart;
|
|
182
|
+
} else {
|
|
183
|
+
// 3. If it DOES exist, ensure RCTLinkingManager is inside it
|
|
184
|
+
// Many Expo apps have an empty continueUserActivity or one that only handles notifications
|
|
185
|
+
if (!contents.includes('RCTLinkingManager')) {
|
|
186
|
+
console.warn("[rns-nativecall] continueUserActivity exists but doesn't have RCTLinkingManager. Manual check required.");
|
|
187
|
+
}
|
|
180
188
|
}
|
|
181
189
|
|
|
182
190
|
config.modResults.contents = contents;
|
|
183
191
|
return config;
|
|
184
192
|
});
|
|
185
193
|
}
|
|
186
|
-
|
|
187
194
|
/** 3. IOS INFO.PLIST CONFIG (Existing) **/
|
|
188
195
|
function withIosConfig(config, props = {}) {
|
|
189
196
|
return withInfoPlist(config, (config) => {
|
|
@@ -199,13 +206,11 @@ function withIosConfig(config, props = {}) {
|
|
|
199
206
|
return config;
|
|
200
207
|
});
|
|
201
208
|
}
|
|
202
|
-
|
|
203
209
|
// Main Plugin Entry
|
|
204
210
|
module.exports = (config, props) => {
|
|
205
211
|
return withPlugins(config, [
|
|
206
212
|
withAndroidConfig,
|
|
207
213
|
withMainActivityDataFix,
|
|
208
|
-
withIosAppDelegateMod, // <--- ADDED THIS HERE
|
|
209
214
|
[withIosConfig, props]
|
|
210
215
|
]);
|
|
211
216
|
};
|