广告屏react-native项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

44 lines
1.4 KiB

  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import "AppDelegate.h"
  8. #import <CodePush/CodePush.h>
  9. #import <React/RCTBridge.h>
  10. #import <React/RCTBundleURLProvider.h>
  11. #import <React/RCTRootView.h>
  12. @implementation AppDelegate
  13. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  14. {
  15. RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  16. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
  17. moduleName:@"screenAd"
  18. initialProperties:nil];
  19. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  20. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  21. UIViewController *rootViewController = [UIViewController new];
  22. rootViewController.view = rootView;
  23. self.window.rootViewController = rootViewController;
  24. [self.window makeKeyAndVisible];
  25. return YES;
  26. }
  27. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  28. {
  29. #if DEBUG
  30. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  31. #else
  32. return [CodePush bundleURL];
  33. #endif
  34. }
  35. @end