2016-04-12 12:31:05 -06:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import "AppDelegate.h"
|
|
|
|
|
2022-05-19 07:29:25 -06:00
|
|
|
#import <React/RCTBridge.h>
|
2017-01-11 05:43:43 -07:00
|
|
|
#import <React/RCTBundleURLProvider.h>
|
|
|
|
#import <React/RCTRootView.h>
|
2016-04-12 12:31:05 -06:00
|
|
|
|
2022-05-19 07:29:25 -06:00
|
|
|
#ifdef FB_SONARKIT_ENABLED
|
|
|
|
#import <FlipperKit/FlipperClient.h>
|
|
|
|
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
|
|
|
|
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
|
|
|
|
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
|
|
|
|
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
|
|
|
|
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
|
|
|
|
|
|
|
|
static void InitializeFlipper(UIApplication *application) {
|
|
|
|
FlipperClient *client = [FlipperClient sharedClient];
|
|
|
|
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
|
|
|
|
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
|
|
|
|
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
|
|
|
|
[client addPlugin:[FlipperKitReactPlugin new]];
|
|
|
|
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
|
|
|
|
[client start];
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-04-12 12:31:05 -06:00
|
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
|
|
{
|
2022-05-19 07:29:25 -06:00
|
|
|
#ifdef FB_SONARKIT_ENABLED
|
|
|
|
InitializeFlipper(application);
|
|
|
|
#endif
|
2016-04-12 12:31:05 -06:00
|
|
|
|
2022-05-19 07:29:25 -06:00
|
|
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
|
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
|
|
|
|
moduleName:@"VideoPlayer"
|
|
|
|
initialProperties:nil];
|
2016-04-12 12:31:05 -06:00
|
|
|
|
2016-09-19 18:46:15 -06:00
|
|
|
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
|
2016-04-12 12:31:05 -06:00
|
|
|
|
|
|
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
UIViewController *rootViewController = [UIViewController new];
|
|
|
|
rootViewController.view = rootView;
|
|
|
|
self.window.rootViewController = rootViewController;
|
|
|
|
[self.window makeKeyAndVisible];
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2022-05-19 07:29:25 -06:00
|
|
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
#if DEBUG
|
|
|
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"src/index" fallbackResource:nil];
|
|
|
|
#else
|
|
|
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-04-12 12:31:05 -06:00
|
|
|
@end
|