forked from vergnet/application-amicale
Removed expo updates specific ios code
This commit is contained in:
parent
f1ed672824
commit
aee51d5dfb
3 changed files with 6 additions and 43 deletions
|
@ -10,9 +10,7 @@
|
||||||
#import <React/RCTBridgeDelegate.h>
|
#import <React/RCTBridgeDelegate.h>
|
||||||
#import <UMCore/UMAppDelegateWrapper.h>
|
#import <UMCore/UMAppDelegateWrapper.h>
|
||||||
|
|
||||||
#import <EXUpdates/EXUpdatesAppController.h>
|
@interface AppDelegate : UMAppDelegateWrapper <RCTBridgeDelegate>
|
||||||
|
|
||||||
@interface AppDelegate : UMAppDelegateWrapper <RCTBridgeDelegate, EXUpdatesAppControllerDelegate>
|
|
||||||
|
|
||||||
@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
|
@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
|
||||||
@property (nonatomic, strong) UIWindow *window;
|
@property (nonatomic, strong) UIWindow *window;
|
||||||
|
|
|
@ -14,12 +14,6 @@
|
||||||
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
|
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
|
||||||
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
|
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
|
||||||
|
|
||||||
@interface AppDelegate ()
|
|
||||||
|
|
||||||
@property (nonatomic, strong) NSDictionary *launchOptions;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
|
|
||||||
@synthesize window = _window;
|
@synthesize window = _window;
|
||||||
|
@ -27,34 +21,20 @@
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
||||||
self.launchOptions = launchOptions;
|
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
||||||
#ifdef DEBUG
|
|
||||||
[self initializeReactNativeApp];
|
|
||||||
#else
|
|
||||||
EXUpdatesAppController *controller = [EXUpdatesAppController sharedInstance];
|
|
||||||
controller.delegate = self;
|
|
||||||
[controller startAndShowLaunchScreen:self.window];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
||||||
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (RCTBridge *)initializeReactNativeApp
|
|
||||||
{
|
|
||||||
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:self.launchOptions];
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:self.launchOptions];
|
||||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
|
||||||
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
|
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
|
||||||
|
|
||||||
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
UIViewController *rootViewController = [UIViewController new];
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
rootViewController.view = rootView;
|
rootViewController.view = rootView;
|
||||||
self.window.rootViewController = rootViewController;
|
self.window.rootViewController = rootViewController;
|
||||||
[self.window makeKeyAndVisible];
|
[self.window makeKeyAndVisible];
|
||||||
|
|
||||||
return bridge;
|
[super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||||
|
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
|
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
|
||||||
|
@ -69,13 +49,8 @@
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||||
#else
|
#else
|
||||||
return [[EXUpdatesAppController sharedInstance] launchAssetUrl];
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)appController:(EXUpdatesAppController *)appController didStartWithSuccess:(BOOL)success
|
|
||||||
{
|
|
||||||
appController.bridge = [self initializeReactNativeApp];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>EXUpdatesSDKVersion</key>
|
|
||||||
<string>YOUR-APP-SDK-VERSION-HERE</string>
|
|
||||||
<key>EXUpdatesURL</key>
|
|
||||||
<string>YOUR-APP-URL-HERE</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Loading…
Reference in a new issue