瀏覽代碼

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

Royce Townsend 8 年之前
父節點
當前提交
fb91ef32cc
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      example/ios/example/AppDelegate.m

+ 3
- 1
example/ios/example/AppDelegate.m 查看文件

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