From 04cf9ee997cc5a13c7f5676d9e0139502f3ee51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20=C5=A0mitala?= Date: Wed, 5 Dec 2018 19:09:11 +0100 Subject: [PATCH] iOS use static bundle for production in template Make it semaless, reduce complexity for newcoming Based on https://facebook.github.io/react-native/docs/running-on-device#3-configure-app-to-use-static-bundle --- local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m b/local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m index d4d87a689fb567..0a959f804385b1 100644 --- a/local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m +++ b/local-cli/templates/HelloWorld/ios/HelloWorld/AppDelegate.m @@ -16,7 +16,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { NSURL *jsCodeLocation; - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; + #ifdef DEBUG + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; + #else + jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + #endif RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"HelloWorld"