49 lines
1.4 KiB
Swift
49 lines
1.4 KiB
Swift
import UIKit
|
|
import ExpoModulesCore
|
|
import React
|
|
|
|
@main
|
|
class AppDelegate: ExpoAppDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
// Make sure the expo modules provider is set up
|
|
let reactNativeWindow = (window as? UIWindow) ?? UIWindow()
|
|
|
|
if #available(iOS 13.0, *) {
|
|
reactNativeWindow.overrideUserInterfaceStyle = .light
|
|
}
|
|
|
|
// Initialize the Expo modules provider
|
|
let reactAppDelegate = ReactAppDelegateWrapper(moduleProvider: {
|
|
return [
|
|
// Add any custom modules here if needed
|
|
]
|
|
})
|
|
|
|
// Call the parent's implementation
|
|
let result = super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
|
|
// Set up the React Native root view
|
|
if let rootView = self.window?.rootViewController?.view as? RCTRootView {
|
|
rootView.backgroundColor = .white
|
|
}
|
|
|
|
return result
|
|
}
|
|
|
|
// MARK: - UISceneSession Lifecycle
|
|
|
|
override func application(
|
|
_ application: UIApplication,
|
|
configurationForConnecting connectingSceneSession: UISceneSession,
|
|
options: UIScene.ConnectionOptions
|
|
) -> UISceneConfiguration {
|
|
return UISceneConfiguration(
|
|
name: "Default Configuration",
|
|
sessionRole: connectingSceneSession.role
|
|
)
|
|
}
|
|
}
|