@@ -77,7 +77,7 @@ exports[`withRNOrientationAppDelegate updates the AppDelegate.mm with both heade
7777"
7878`;
7979
80- exports[`withRNOrientationAppDelegate updates the AppDelegate .swift with the method implementation 1`] = `
80+ exports[`withRNOrientationAppDelegate updates the AppDelegate52 .swift with the method implementation having override when sdk is < 53 1`] = `
8181"import UIKit
8282import React
8383import React_RCTAppDelegate
@@ -117,3 +117,84 @@ class AppDelegate: RCTAppDelegate {
117117}
118118"
119119`;
120+
121+ exports [` withRNOrientationAppDelegate updates the AppDelegate53.swift with the method implementation without override when sdk is >= 53 1` ] = `
122+ "import Expo
123+ import React
124+ import ReactAppDependencyProvider
125+
126+ @UIApplicationMain
127+ public class AppDelegate: ExpoAppDelegate {
128+ var window : UIWindow ?
129+
130+ var reactNativeDelegate : ExpoReactNativeFactoryDelegate ?
131+ var reactNativeFactory : RCTReactNativeFactory ?
132+
133+ public override func application (
134+ _ application : UIApplication ,
135+ didFinishLaunchingWithOptions launchOptions : [UIApplication .LaunchOptionsKey : Any ]? = nil
136+ ) - > Bool {
137+ let delegate = ReactNativeDelegate()
138+ let factory = ExpoReactNativeFactory(delegate : delegate )
139+ delegate.dependencyProvider = RCTAppDependencyProvider()
140+
141+ reactNativeDelegate = delegate
142+ reactNativeFactory = factory
143+ bindReactNativeFactory(factory )
144+
145+ #if os(iOS ) || os(tvOS )
146+ window = UIWindow(frame : UIScreen .main .bounds )
147+ factory.startReactNative(
148+ withModuleName : " main" ,
149+ in : window ,
150+ launchOptions : launchOptions )
151+ #endif
152+
153+ return super.application(application , didFinishLaunchingWithOptions : launchOptions )
154+ }
155+ // React Native Orientation Director @generated begin @react-native-orientation-director/supportedInterfaceOrientationsFor-implementation - expo prebuild (DO NOT MODIFY) sync-e6869f486930a8ef16098c6ceec0011ee7ff621f
156+
157+ func application (_ application : UIApplication , supportedInterfaceOrientationsFor window : UIWindow ? ) - > UIInterfaceOrientationMask {
158+ return OrientationDirector.getSupportedInterfaceOrientationsForWindow()
159+ }
160+
161+ // React Native Orientation Director @generated end @react-native-orientation-director/supportedInterfaceOrientationsFor-implementation
162+
163+ // Linking API
164+ public override func application (
165+ _ app : UIApplication ,
166+ open url : URL ,
167+ options : [UIApplication .OpenURLOptionsKey : Any ] = [:]
168+ ) - > Bool {
169+ return super.application(app , open : url , options : options ) || RCTLinkingManager.application(app , open : url , options : options )
170+ }
171+
172+ // Universal Links
173+ public override func application (
174+ _ application : UIApplication ,
175+ continue userActivity : NSUserActivity ,
176+ restorationHandler : @escaping ([UIUserActivityRestoring ]? ) - > Void
177+ ) - > Bool {
178+ let result = RCTLinkingManager.application(application , continue : userActivity , restorationHandler : restorationHandler )
179+ return super.application(application , continue : userActivity , restorationHandler : restorationHandler ) || result
180+ }
181+ }
182+
183+ class ReactNativeDelegate : ExpoReactNativeFactoryDelegate {
184+ // Extension point for config-plugins
185+
186+ override func sourceURL(for bridge : RCTBridge ) -> URL? {
187+ // needed to return the correct URL for expo-dev-client.
188+ bridge .bundleURL ?? bundleURL ()
189+ }
190+
191+ override func bundleURL () - > URL ? {
192+ #if DEBUG
193+ return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot : " .expo/.virtual-metro-entry" )
194+ #else
195+ return Bundle.main.url(forResource : " main" , withExtension : " jsbundle" )
196+ #endif
197+ }
198+ }
199+ "
200+ `;
0 commit comments