广告屏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.
 
 
 
 
 

42 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/RCTBundleURLProvider.h>
  10. #import <React/RCTRootView.h>
  11. @implementation AppDelegate
  12. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  13. {
  14. NSURL *jsCodeLocation;
  15. #ifdef DEBUG
  16. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  17. #else
  18. jsCodeLocation = [CodePush bundleURL];
  19. #endif
  20. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  21. moduleName:@"screenAd"
  22. initialProperties:nil
  23. launchOptions:launchOptions];
  24. rootView.backgroundColor = [UIColor blackColor];
  25. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  26. UIViewController *rootViewController = [UIViewController new];
  27. rootViewController.view = rootView;
  28. self.window.rootViewController = rootViewController;
  29. [self.window makeKeyAndVisible];
  30. return YES;
  31. }
  32. @end