1+ import Expo
12import Firebase
23import FirebaseMessaging
34import RNBootSplash
@@ -8,7 +9,7 @@ import UIKit
89import UserNotifications
910
1011@main
11- class AppDelegate : UIResponder , UIApplicationDelegate {
12+ class AppDelegate : ExpoAppDelegate {
1213 var window : UIWindow ?
1314 var securityView : UIView ?
1415
@@ -19,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1920 * Handles deep links.
2021 * From https://reactnative.dev/docs/0.79/linking?ios-language=swift#enabling-deep-links
2122 */
22- func application(
23+ override func application(
2324 _ app: UIApplication , open url: URL , options: [ UIApplication . OpenURLOptionsKey : Any ] = [ : ]
2425 ) -> Bool {
2526 return RCTLinkingManager . application ( app, open: url, options: options)
@@ -29,7 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2930 * Handles deep links.
3031 * From https://reactnative.dev/docs/0.79/linking?ios-language=swift#enabling-deep-links
3132 */
32- func application(
33+ override func application(
3334 _ application: UIApplication ,
3435 continue userActivity: NSUserActivity ,
3536 restorationHandler: @escaping ( [ UIUserActivityRestoring ] ? ) -> Void
@@ -45,7 +46,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4546 * Handles app start-up.
4647 * React Native template code.
4748 */
48- func application(
49+ override func application(
4950 _ application: UIApplication ,
5051 didFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ? = nil
5152 ) -> Bool {
@@ -58,11 +59,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5859
5960 // React Native template code:
6061 let delegate = ReactNativeDelegate ( )
61- let factory = RCTReactNativeFactory ( delegate: delegate)
62+ let factory = ExpoReactNativeFactory ( delegate: delegate)
6263 delegate. dependencyProvider = RCTAppDependencyProvider ( )
6364
6465 reactNativeDelegate = delegate
6566 reactNativeFactory = factory
67+ bindReactNativeFactory ( factory)
6668
6769 window = UIWindow ( frame: UIScreen . main. bounds)
6870
@@ -72,14 +74,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7274 launchOptions: launchOptions
7375 )
7476
75- return true
77+ return super . application ( application , didFinishLaunchingWithOptions : launchOptions )
7678 }
7779
7880 /**
7981 * Periodic background fetch logic.
8082 * Edge addition.
8183 */
82- func application(
84+ override func application(
8385 _ application: UIApplication ,
8486 performFetchWithCompletionHandler completionHandler: @escaping ( UIBackgroundFetchResult ) -> Void
8587 ) {
@@ -128,7 +130,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
128130 * Hides the app when we go into the background.
129131 * Edge addition.
130132 */
131- func applicationDidEnterBackground( _ application: UIApplication ) {
133+ override func applicationDidEnterBackground( _ application: UIApplication ) {
132134 guard
133135 let storyboard = UIStoryboard ( name: " LaunchScreen " , bundle: nil ) as UIStoryboard ? ,
134136 let launchScreen = storyboard. instantiateInitialViewController ( ) ,
@@ -148,7 +150,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
148150 * Shows the app when we come into the foreground.
149151 * Edge addition.
150152 */
151- func applicationWillEnterForeground( _ application: UIApplication ) {
153+ override func applicationWillEnterForeground( _ application: UIApplication ) {
152154 if let view = securityView {
153155 view. removeFromSuperview ( )
154156 securityView = nil
@@ -158,13 +160,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
158160
159161/// Configures the React Native instance.
160162/// React Native template code.
161- class ReactNativeDelegate : RCTDefaultReactNativeFactoryDelegate {
163+ class ReactNativeDelegate : ExpoReactNativeFactoryDelegate {
162164 override func sourceURL( for bridge: RCTBridge ) -> URL ? {
163165 self . bundleURL ( )
164166 }
165167
166168 // react-native-bootsplash integration:
167- override func customize( _ rootView: RCTRootView ) {
169+ override func customize( _ rootView: UIView ) {
168170 super. customize ( rootView)
169171 RNBootSplash . initWithStoryboard ( " LaunchScreen " , rootView: rootView)
170172 }
0 commit comments