diff --git a/ios/MyApp/AppDelegate.h b/ios/MyApp/AppDelegate.h index ef1de86..d3d75b0 100644 --- a/ios/MyApp/AppDelegate.h +++ b/ios/MyApp/AppDelegate.h @@ -1,7 +1,8 @@ #import +#import #import -@interface AppDelegate : UIResponder +@interface AppDelegate : EXAppDelegateWrapper @property (nonatomic, strong) UIWindow *window; diff --git a/ios/MyApp/AppDelegate.m b/ios/MyApp/AppDelegate.m index da9f60a..0164063 100644 --- a/ios/MyApp/AppDelegate.m +++ b/ios/MyApp/AppDelegate.m @@ -31,8 +31,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( InitializeFlipper(application); #endif - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; + RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"MyApp" initialProperties:nil]; @@ -43,10 +43,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; + UIViewController *rootViewController = [self.reactDelegate createRootViewController]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; + [super application:application didFinishLaunchingWithOptions:launchOptions]; return YES; } diff --git a/ios/Podfile b/ios/Podfile index 99b1b8d..71524e2 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,9 +1,18 @@ +require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '10.0' +platform :ios, '12.0' target 'ModuleDiff' do + use_expo_modules! + post_integrate do |installer| + begin + expo_patch_react_imports!(installer) + rescue => e + Pod::UI.warn e + end + end config = use_native_modules!