1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * 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/RCTBridge.h>
- #import <React/RCTBundleURLProvider.h>
- #import <React/RCTRootView.h>
- #import <React/RCTLinkingManager.h>
- @implementation AppDelegate
- // ios 8.x or older
- - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
- sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
- {
- return [RCTLinkingManager application:application openURL:url
- sourceApplication:sourceApplication annotation:annotation];
- }
- // ios 9.0+
- - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
- options:(NSDictionary<NSString*, id> *)options
- {
- return [RCTLinkingManager application:application openURL:url options:options];
- }
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- {
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
- RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
- moduleName:@"TaxControlApp"
- initialProperties:nil];
- 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];
- rootViewController.view = rootView;
- self.window.rootViewController = rootViewController;
- [self.window makeKeyAndVisible];
- return YES;
- }
- - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
- {
- #if DEBUG
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
- #else
- // return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
- return [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"index.ios.jsbundle" ofType:nil]];
- #endif
- }
- @end
|