internal import Expo import React import ReactAppDependencyProvider @main class AppDelegate: ExpoAppDelegate { var window: UIWindow? var reactNativeDelegate: ReactNativeDelegate? var reactNativeFactory: RCTReactNativeFactory? var launchOptions: [UIApplication.LaunchOptionsKey: Any]? override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { let delegate = ReactNativeDelegate() let factory = ExpoReactNativeFactory(delegate: delegate) delegate.dependencyProvider = RCTAppDependencyProvider() reactNativeDelegate = delegate reactNativeFactory = factory self.launchOptions = launchOptions return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } class ReactNativeDelegate: ExpoReactNativeFactoryDelegate { override func sourceURL(for bridge: RCTBridge) -> URL? { bridge.bundleURL ?? bundleURL() } override func bundleURL() -> URL? { #if DEBUG RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry") #else Bundle.main.url(forResource: "main", withExtension: "jsbundle") #endif } }