public class DevSupportManager extends java.lang.Object implements NativeModuleCallExceptionHandler
ReactInstanceDevCommandsHandler implementation is responsible for instantiating this
instance and for populating with an instance of CatalystInstance whenever instance
manager recreates it (through #onNewCatalystContextCreated). Also, instance manager is
responsible for enabling/disabling dev support in case when app is backgrounded or when all the
views has been detached from the instance (through setDevSupportEnabled(boolean) method).
IMPORTANT: In order for developer support to work correctly it is required that the
manifest of your application contain the following entries:
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>| Constructor and Description |
|---|
DevSupportManager(android.content.Context applicationContext,
ReactInstanceDevCommandsHandler reactInstanceCommandsHandler,
java.lang.String packagerPathForJSBundleName,
boolean enableOnCreate) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCustomDevOption(java.lang.String optionName,
DevOptionHandler optionHandler)
Add option item to dev settings dialog displayed by this manager.
|
DeveloperSettings |
getDevSettings() |
boolean |
getDevSupportEnabled() |
java.lang.String |
getDownloadedJSBundleFile() |
java.lang.String |
getJSBundleURLForRemoteDebugging() |
java.lang.String |
getSourceMapUrl() |
java.lang.String |
getSourceUrl() |
void |
handleException(java.lang.Exception e)
Do something to display or log the exception.
|
void |
handleReloadJS() |
boolean |
hasBundleInAssets(java.lang.String bundleAssetName) |
boolean |
hasUpToDateJSBundleInCache() |
void |
onNewReactContextCreated(ReactContext reactContext) |
void |
onReactInstanceDestroyed(ReactContext reactContext) |
void |
setDevSupportEnabled(boolean isDevSupportEnabled)
ReactInstanceDevCommandsHandler is responsible for
enabling/disabling dev support when a React view is attached/detached
or when application state changes (e.g. |
void |
showDevOptionsDialog() |
void |
showNewJSError(java.lang.String message,
ReadableArray details,
int errorCookie) |
void |
updateJSError(java.lang.String message,
ReadableArray details,
int errorCookie) |
public DevSupportManager(android.content.Context applicationContext,
ReactInstanceDevCommandsHandler reactInstanceCommandsHandler,
@Nullable
java.lang.String packagerPathForJSBundleName,
boolean enableOnCreate)
public void handleException(java.lang.Exception e)
NativeModuleCallExceptionHandlerhandleException in interface NativeModuleCallExceptionHandlerpublic void addCustomDevOption(java.lang.String optionName,
DevOptionHandler optionHandler)
public void showNewJSError(java.lang.String message,
ReadableArray details,
int errorCookie)
public void updateJSError(java.lang.String message,
ReadableArray details,
int errorCookie)
public void showDevOptionsDialog()
public void setDevSupportEnabled(boolean isDevSupportEnabled)
ReactInstanceDevCommandsHandler is responsible for
enabling/disabling dev support when a React view is attached/detached
or when application state changes (e.g. the application is backgrounded).public boolean getDevSupportEnabled()
public DeveloperSettings getDevSettings()
public void onNewReactContextCreated(ReactContext reactContext)
public void onReactInstanceDestroyed(ReactContext reactContext)
public java.lang.String getSourceMapUrl()
public java.lang.String getSourceUrl()
public java.lang.String getJSBundleURLForRemoteDebugging()
public java.lang.String getDownloadedJSBundleFile()
public boolean hasUpToDateJSBundleInCache()
true if ReactInstanceManager should use downloaded JS bundle file
instead of using JS file from assets. This may happen when app has not been updated since
the last time we fetched the bundle.public boolean hasBundleInAssets(java.lang.String bundleAssetName)
true if JS bundle exists, in that case
ReactInstanceManager should use that file from assets instead of downloading bundle
from dev serverpublic void handleReloadJS()