Application Android et IOS pour l'amicale des élèves
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.

AppDelegate.m 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 <React/RCTBundleURLProvider.h>
  9. #import <React/RCTRootView.h>
  10. #import <UMCore/UMModuleRegistry.h>
  11. #import <UMReactNativeAdapter/UMNativeModulesProxy.h>
  12. #import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
  13. #import <React/RCTLinkingManager.h>
  14. @implementation AppDelegate
  15. @synthesize window = _window;
  16. - (BOOL)application:(UIApplication *)application
  17. openURL:(NSURL *)url
  18. options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
  19. {
  20. return [RCTLinkingManager application:application openURL:url options:options];
  21. }
  22. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  23. {
  24. self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
  25. RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  26. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
  27. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  28. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  29. UIViewController *rootViewController = [UIViewController new];
  30. rootViewController.view = rootView;
  31. self.window.rootViewController = rootViewController;
  32. [self.window makeKeyAndVisible];
  33. [super application:application didFinishLaunchingWithOptions:launchOptions];
  34. return YES;
  35. }
  36. - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
  37. {
  38. NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
  39. // You can inject any extra modules that you would like here, more information at:
  40. // https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
  41. return extraModules;
  42. }
  43. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
  44. #ifdef DEBUG
  45. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  46. #else
  47. return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  48. #endif
  49. }
  50. @end