chore: ios wip

This commit is contained in:
devthejo 2025-12-08 22:43:59 +01:00
parent 2da80b0ca9
commit f69e959eb6

View file

@ -1,71 +1,8 @@
import EXUpdates import Foundation
import FirebaseCore
import React
import TSBackgroundFetch
import UIKit
@objc(AppDelegate) /// Legacy RCTAppDelegate-based implementation removed.
class AppDelegate: RCTAppDelegate { /// The real application delegate is `AppDelegate: ExpoAppDelegate` in `AppDelegate.swift`.
override func application( /// This placeholder exists only to satisfy any stale Xcode references and has no effect
_ application: UIApplication, /// on application startup or expo-updates behavior.
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil @objc(NoopLegacyAppDelegate)
) -> Bool { class NoopLegacyAppDelegate: NSObject {}
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
}
}