mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-11 19:01:43 +08:00
Removes hardcoded port 8081 from URL format strings
Summary: This allows the use of different bundle URLs & ports in Dev mode. (ie. ngrok url shared with a team member)
The bundle URL can be changed via the normal Dev Menu, or programmatically by setting the `debug_http_host` shared preference key.
For example, in your apps `MainActivity.java` before creating your `ReactRootView`:
```java
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(getApplication());
SharedPreferences.Editor editor = mPreferences.edit();
editor.putString("debug_http_host", "my.customurlandport.com:8888");
editor.commit();
```
**Breaking change**: Custom bundle URLs added via the Dev Menu will need to also include the port. This has been noted in the documentation and also on the preference description in the Dev Menu.
Addresses: https://github.com/facebook/react-native/issues/2704
Closes https://github.com/facebook/react-native/pull/2824
Reviewed By: @svcscm
Differential Revision: D2540450
Pulled By: @javache
fb-gh-sync-id: a053de91e3095bb67640bb0f1b8761e55775bc9c
This commit is contained in:
committed by
facebook-github-bot-7
parent
45644aab35
commit
c2ae790396
@@ -38,8 +38,8 @@
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:key="debug_http_host"
|
||||
android:title="Debug server host for device"
|
||||
android:summary="Debug server host for downloading JS bundle or communicating with JS debugger. With this setting empty launcher should work fine when running on emulator (or genymotion) and connection to debug server running on emulator's host"
|
||||
android:title="Debug server host & port for device"
|
||||
android:summary="Debug server host & port for downloading JS bundle or communicating with JS debugger. With this setting empty launcher should work fine when running on emulator (or genymotion) and connection to debug server running on emulator's host."
|
||||
android:defaultValue=""
|
||||
/>
|
||||
</PreferenceCategory>
|
||||
|
||||
Reference in New Issue
Block a user