Browse Source

Example app guesses the IP address for you. (#637)

Royce Townsend 7 years ago
parent
commit
fb91ef32cc
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      example/ios/example/AppDelegate.m

+ 3
- 1
example/ios/example/AppDelegate.m View File

1
 #import "AppDelegate.h"
1
 #import "AppDelegate.h"
2
+#import "RCTBundleURLProvider.h"
2
 
3
 
3
 // **********************************************
4
 // **********************************************
4
 // *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
5
 // *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
16
 {
17
 {
17
   NSURL *jsCodeLocation;
18
   NSURL *jsCodeLocation;
18
 #ifdef DEBUG
19
 #ifdef DEBUG
19
-  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
20
+//  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
21
+  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
20
 #else
22
 #else
21
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
22
 #endif
24
 #endif