ecency-mobile/ios/Ecency/AppDelegate.m

62 lines
2.1 KiB
Mathematica
Raw Normal View History

2018-12-05 00:18:46 +03:00
/**
2019-09-11 22:42:49 +03:00
* Copyright (c) Facebook, Inc. and its affiliates.
2018-12-05 00:18:46 +03:00
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
2020-03-22 09:02:08 +03:00
#import "RNSplashScreen.h"
2018-12-05 00:18:46 +03:00
#import "AppDelegate.h"
2019-09-11 22:42:49 +03:00
#import <AppCenterReactNativeShared/AppCenterReactNativeShared.h>
#import <AppCenterReactNative.h>
#import <AppCenterReactNativeAnalytics.h>
#import <AppCenterReactNativeCrashes.h>
2019-10-15 13:59:15 +03:00
#import <BugsnagReactNative/BugsnagReactNative.h>
#import <Firebase.h>
2018-12-05 00:18:46 +03:00
2019-09-11 22:42:49 +03:00
#import <React/RCTBridge.h>
2018-12-05 00:18:46 +03:00
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
2019-01-21 17:02:25 +03:00
#import <React/RCTLinkingManager.h>
2018-12-05 00:18:46 +03:00
@implementation AppDelegate
2020-07-28 18:46:43 +03:00
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
2019-01-21 17:02:25 +03:00
{
2020-07-28 18:46:43 +03:00
return [RCTLinkingManager application:application openURL:url options:options];
2019-01-21 17:02:25 +03:00
}
2018-12-05 00:18:46 +03:00
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
2019-09-11 22:42:49 +03:00
[AppCenterReactNative register];
[AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true];
[AppCenterReactNativeCrashes registerWithAutomaticProcessing];
2019-10-15 13:59:15 +03:00
[BugsnagReactNative start];
2019-05-29 14:32:35 +03:00
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
2020-07-17 14:22:06 +03:00
moduleName:@"Ecency"
2019-05-29 14:32:35 +03:00
initialProperties:nil];
2018-12-05 00:18:46 +03:00
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];
2020-03-22 09:02:08 +03:00
[RNSplashScreen show];
2018-12-05 00:18:46 +03:00
return YES;
}
2019-05-29 14:32:35 +03:00
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
}
2018-12-05 00:18:46 +03:00
@end