application-amicale/ios/Campus/AppDelegate.m

68 lines
2.3 KiB
Mathematica
Raw Normal View History

2020-04-25 15:09:08 +02:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UMCore/UMModuleRegistry.h>
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
2020-04-26 22:35:34 +02:00
#import <React/RCTLinkingManager.h>
2020-04-28 08:31:11 +02:00
#import "RNSplashScreen.h"
2020-04-26 22:35:34 +02:00
2020-04-25 15:09:08 +02:00
@implementation AppDelegate
@synthesize window = _window;
2020-04-26 22:35:34 +02:00
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
2020-04-25 15:09:08 +02:00
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
2020-04-26 12:45:35 +02:00
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
2020-04-25 15:09:08 +02:00
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];
2020-04-25 22:59:53 +02:00
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
2020-04-25 15:09:08 +02:00
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
2020-04-25 22:59:53 +02:00
[super application:application didFinishLaunchingWithOptions:launchOptions];
2020-04-28 08:31:11 +02:00
[RNSplashScreen show];
2020-04-25 22:59:53 +02:00
return YES;
2020-04-25 15:09:08 +02:00
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
// You can inject any extra modules that you would like here, more information at:
// https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
return extraModules;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
2020-04-25 22:59:53 +02:00
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
2020-04-25 15:09:08 +02:00
#endif
}
@end