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

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