react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Configure react native android jscodelocation

Open Matthew-C opened this issue 11 years ago • 2 comments

How am I suppose to configure jscodelocation for react native android in real product? Is it doable?

Matthew-C avatar Sep 15 '15 19:09 Matthew-C

During development you can set a key in SharedPreferences called "debug_http_host" to configure the host of the packager server.

SharedPreferences preferences =
   PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
preferences.edit().putString("debug_http_host", "localhost").apply();

Currently you can curl/wget your JS from the packager, include it with your APK, and tell the ReactInstanceManager to load the JS from an asset (see setBundleAssetName). That is the extent to which you can customize things for now. See https://github.com/facebook/react-native/issues/2703#issuecomment-140288212 for specifics.

ide avatar Sep 15 '15 20:09 ide

Thanks, will try.

Matthew-C avatar Sep 15 '15 20:09 Matthew-C