chore: ios wip
This commit is contained in:
parent
2da80b0ca9
commit
f69e959eb6
1 changed files with 7 additions and 70 deletions
|
|
@ -1,71 +1,8 @@
|
|||
import EXUpdates
|
||||
import FirebaseCore
|
||||
import React
|
||||
import TSBackgroundFetch
|
||||
import UIKit
|
||||
import Foundation
|
||||
|
||||
@objc(AppDelegate)
|
||||
class AppDelegate: RCTAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
||||
) -> Bool {
|
||||
NSLog("[AppDelegate] didFinishLaunchingWithOptions (RCTAppDelegate)")
|
||||
|
||||
// Configure Firebase (react-native-firebase).
|
||||
FirebaseApp.configure()
|
||||
|
||||
// Transistorsoft background fetch bootstrap.
|
||||
TSBackgroundFetch.sharedInstance().didFinishLaunching()
|
||||
NSLog("[AppDelegate] TSBackgroundFetch didFinishLaunching")
|
||||
|
||||
// Initialize expo-updates controller so AppController.sharedInstance can be used safely.
|
||||
AppController.initializeWithoutStarting()
|
||||
|
||||
// Configure React Native root module.
|
||||
self.moduleName = "main"
|
||||
self.initialProps = [:]
|
||||
|
||||
let result = super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
NSLog("[AppDelegate] super.application(...) -> %@", result ? "true" : "false")
|
||||
return result
|
||||
}
|
||||
|
||||
// MARK: - RCTBridgeDelegate / JS bundle location
|
||||
|
||||
@objc
|
||||
override func sourceURL(for bridge: RCTBridge!) -> URL! {
|
||||
#if DEBUG
|
||||
let url = RCTBundleURLProvider.sharedSettings().jsBundleURL(
|
||||
forBundleRoot: ".expo/.virtual-metro-entry",
|
||||
fallbackExtension: nil
|
||||
)
|
||||
NSLog("[AppDelegate] sourceURL(for:) (DEBUG) -> %@", url?.absoluteString ?? "nil")
|
||||
return url
|
||||
#else
|
||||
let url = self.bundleURL()
|
||||
NSLog("[AppDelegate] sourceURL(for:) (RELEASE) -> %@", url?.absoluteString ?? "nil")
|
||||
return url
|
||||
#endif
|
||||
}
|
||||
|
||||
@objc
|
||||
override func bundleURL() -> URL! {
|
||||
#if DEBUG
|
||||
let url = RCTBundleURLProvider.sharedSettings().jsBundleURL(
|
||||
forBundleRoot: ".expo/.virtual-metro-entry",
|
||||
fallbackExtension: nil
|
||||
)
|
||||
NSLog("[AppDelegate] bundleURL() (DEBUG) -> %@", url?.absoluteString ?? "nil")
|
||||
return url
|
||||
#else
|
||||
let url = Bundle.main.url(forResource: "main", withExtension: "jsbundle")
|
||||
if let url = url {
|
||||
NSLog("[AppDelegate] bundleURL() (RELEASE) -> %@", url.absoluteString)
|
||||
} else {
|
||||
NSLog("[AppDelegate] bundleURL() (RELEASE) -> nil (main.jsbundle not found)")
|
||||
}
|
||||
return url
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/// Legacy RCTAppDelegate-based implementation removed.
|
||||
/// The real application delegate is `AppDelegate: ExpoAppDelegate` in `AppDelegate.swift`.
|
||||
/// This placeholder exists only to satisfy any stale Xcode references and has no effect
|
||||
/// on application startup or expo-updates behavior.
|
||||
@objc(NoopLegacyAppDelegate)
|
||||
class NoopLegacyAppDelegate: NSObject {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue