From cd6c7584c45901a8ab0728211955087e4aaa0cc1 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 25 Jan 2022 09:43:13 +0100 Subject: [PATCH] fix(apple): `-jsBundleURLForBundleRoot:fallbackResource:` was removed For more details, see https://github.com/facebook/react-native/commit/0912ee179c210fb6b2ed9afbb3f2fbc5fb8a2bb3. --- ios/ReactTestApp/ReactInstance.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ios/ReactTestApp/ReactInstance.swift b/ios/ReactTestApp/ReactInstance.swift index da3198055..335ab4df6 100644 --- a/ios/ReactTestApp/ReactInstance.swift +++ b/ios/ReactTestApp/ReactInstance.swift @@ -5,10 +5,7 @@ final class ReactInstance: NSObject, RCTBridgeDelegate { NSNotification.Name("ReactInstance.scanForQRCodeNotification") static func jsBundleURL() -> URL? { - RCTBundleURLProvider.sharedSettings().jsBundleURL( - forBundleRoot: "index", - fallbackResource: nil - ) + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") { nil } } var remoteBundleURL: URL? { @@ -131,7 +128,7 @@ final class ReactInstance: NSObject, RCTBridgeDelegate { return remoteBundleURL } - let jsBundleURL = entryFiles() + let embeddedBundleURL = entryFiles() .lazy .map { Bundle.main.url( @@ -140,7 +137,7 @@ final class ReactInstance: NSObject, RCTBridgeDelegate { ) } .first(where: { $0 != nil }) - return jsBundleURL ?? ReactInstance.jsBundleURL() + return embeddedBundleURL ?? ReactInstance.jsBundleURL() } func extraModules(for _: RCTBridge!) -> [RCTBridgeModule] {