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.0KB

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