react-native-webview.git

AppDelegate.m 981B

12345678910111213141516171819202122232425262728293031323334353637383940
  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/RCTBridge.h>
  9. #import <React/RCTBundleURLProvider.h>
  10. @interface AppDelegate () <RCTBridgeDelegate>
  11. @end
  12. @implementation AppDelegate
  13. - (void)awakeFromNib {
  14. [super awakeFromNib];
  15. _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
  16. }
  17. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  18. // Insert code here to initialize your application
  19. }
  20. - (void)applicationWillTerminate:(NSNotification *)aNotification {
  21. // Insert code here to tear down your application
  22. }
  23. #pragma mark - RCTBridgeDelegate Methods
  24. - (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge {
  25. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:@"main"]; // .jsbundle;
  26. }
  27. @end