暫無描述

AppDelegate.m 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  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 <React/RCTBundleURLProvider.h>
  9. #import <React/RCTRootView.h>
  10. #import "RCCManager.h"
  11. #import <RCCNavigationController.h>
  12. #import <AVFoundation/AVFoundation.h>
  13. #import "OssViewController.h"
  14. @implementation AppDelegate
  15. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  16. {
  17. NSURL *jsCodeLocation;
  18. #ifdef DEBUG
  19. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  20. #else
  21. jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  22. #endif
  23. // **********************************************
  24. // *** DON'T MISS: THIS IS HOW WE BOOTSTRAP *****
  25. // **********************************************
  26. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  27. self.window.backgroundColor = [UIColor whiteColor];
  28. [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
  29. [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
  30. return YES;
  31. }
  32. @end