diff --git a/examples/ReactExample/ios/ReactExample/AppDelegate.m b/examples/ReactExample/ios/ReactExample/AppDelegate.m index adaf8f33..49d8054a 100644 --- a/examples/ReactExample/ios/ReactExample/AppDelegate.m +++ b/examples/ReactExample/ios/ReactExample/AppDelegate.m @@ -12,9 +12,8 @@ { NSURL *jsCodeLocation; +#if TARGET_OS_SIMULATOR /** - * Loading JavaScript code - uncomment the one you want. - * * OPTION 1 * Load from development server. Start the server from the repository root: * @@ -26,19 +25,21 @@ * on the same Wi-Fi network. */ - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios"]; +#if DEBUG + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; +#else + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=false"]; +#endif +#else /** * OPTION 2 - * Load from pre-bundled file on disk. To re-generate the static bundle - * from the root of your project directory, run - * - * $ react-native bundle --minify - * - * see http://facebook.github.io/react-native/docs/runningondevice.html + * Load from pre-bundled file on disk. The static bundle is automatically + * generated by "Bundle React Native code and images" build step. */ - // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; +#endif RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"ReactExample"