Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

AppDelegate.m 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "AppDelegate.h"
  10. #import "RCTBundleURLProvider.h"
  11. #import "RCTLinkingManager.h"
  12. #import "RCTRootView.h"
  13. @implementation AppDelegate
  14. // https://facebook.github.io/react-native/docs/linking.html
  15. - (BOOL)application:(UIApplication *)application
  16. continueUserActivity:(NSUserActivity *)userActivity
  17. restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
  18. {
  19. return [RCTLinkingManager application:application
  20. continueUserActivity:userActivity
  21. restorationHandler:restorationHandler];
  22. }
  23. - (BOOL)application:(UIApplication *)application
  24. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  25. {
  26. NSURL *jsCodeLocation
  27. = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios"
  28. fallbackResource:nil];
  29. RCTRootView *rootView
  30. = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  31. moduleName:@"App"
  32. initialProperties:nil
  33. launchOptions:launchOptions];
  34. // Set a background color which is in accord with the JavaScript and Android
  35. // parts of the application and causes less perceived visual flicker than the
  36. // default background color.
  37. rootView.backgroundColor
  38. = [[UIColor alloc] initWithRed:.07f green:.07f blue:.07f alpha:1];
  39. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  40. UIViewController *rootViewController = [UIViewController new];
  41. rootViewController.view = rootView;
  42. self.window.rootViewController = rootViewController;
  43. [self.window makeKeyAndVisible];
  44. return YES;
  45. }
  46. // https://facebook.github.io/react-native/docs/linking.html
  47. - (BOOL)application:(UIApplication *)application
  48. openURL:(NSURL *)url
  49. sourceApplication:(NSString *)sourceApplication
  50. annotation:(id)annotation
  51. {
  52. return [RCTLinkingManager application:application
  53. openURL:url
  54. sourceApplication:sourceApplication
  55. annotation:annotation];
  56. }
  57. @end