AppDelegate.mm 800 B

12345678910111213141516171819202122232425262728293031
  1. #import "AppDelegate.h"
  2. #import <React/RCTBundleURLProvider.h>
  3. @implementation AppDelegate
  4. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  5. {
  6. self.moduleName = @"nxsample";
  7. // You can add your custom initial props in the dictionary below.
  8. // They will be passed down to the ViewController used by React Native.
  9. self.initialProps = @{};
  10. return [super application:application didFinishLaunchingWithOptions:launchOptions];
  11. }
  12. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  13. {
  14. return [self bundleURL];
  15. }
  16. - (NSURL *)bundleURL
  17. {
  18. #if DEBUG
  19. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
  20. #else
  21. return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  22. #endif
  23. }
  24. @end