application-amicale/ios/Campus/AppDelegate.m

53 lines
1.6 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>
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
{
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-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
}
- (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