BridgeDevSupportManager

Interface for accessing and interacting with development features. Following features are supported through this manager class: 1) Displaying JS errors (aka RedBox) 2) Displaying developers menu (Reload JS, Debug JS) 3) Communication with developer server in order to download updated JS bundle 4) Starting/stopping broadcast receiver for js reload signals 5) Starting/stopping motion sensor listener that recognize shake gestures which in turn may trigger developers menu. 6) Launching developers settings view This class automatically monitors the state of registered views and activities to which they are bound to make sure that we don't display overlay or that we we don't listen for sensor events when app is backgrounded. com.facebook.react.ReactInstanceManager implementation is responsible for instantiating this class as well as for populating with a reference to CatalystInstance whenever instance manager recreates it (through ). 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 { } method).

Constructors

Link copied to clipboard
constructor(applicationContext: Context, reactInstanceManagerHelper: ReactInstanceDevHelper, @Nullable packagerPathForJSBundleName: String, enableOnCreate: Boolean, @Nullable redBoxHandler: RedBoxHandler, @Nullable devBundleDownloadListener: DevBundleDownloadListener, minNumShakes: Int, @Nullable customPackagerCommandHandlers: Map<String, RequestHandler>, @Nullable surfaceDelegateFactory: SurfaceDelegateFactory, @Nullable devLoadingViewManager: DevLoadingViewManager, @Nullable pausedInDebuggerOverlayManager: PausedInDebuggerOverlayManager)

Functions

Link copied to clipboard
open fun addCustomDevOption(optionName: String, optionHandler: DevOptionHandler)
Add option item to dev settings dialog displayed by this manager.
abstract fun addCustomDevOption(optionName: String, optionHandler: DevOptionHandler)
Link copied to clipboard
open fun createRootView(appKey: String): View
abstract fun createRootView(appKey: String): View
Link copied to clipboard
Create the surface delegate that the provided module should use to interact with
abstract fun createSurfaceDelegate(moduleName: String): SurfaceDelegate

Create the surface delegate that the provided module should use to interact with

Link copied to clipboard
open fun destroyRootView(@Nullable rootView: View)
abstract fun destroyRootView(rootView: View)
Link copied to clipboard
open fun downloadBundleResourceFromUrlSync(resourceURL: String, outputFile: File): File
abstract fun downloadBundleResourceFromUrlSync(resourceURL: String, outputFile: File): File
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getLastErrorCookie(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getSourceMapUrl(): String
Link copied to clipboard
open fun getSourceUrl(): String
abstract fun getSourceUrl(): String
Link copied to clipboard
abstract fun handleException(e: Exception)

Do something to display or log the exception.

Do something to display or log the exception.
Link copied to clipboard
open fun handleReloadJS()
Link copied to clipboard
Hides the "paused in debugger" overlay, if currently shown.

Hides the "paused in debugger" overlay, if currently shown.

Link copied to clipboard
open fun hideRedboxDialog()
abstract fun hideRedboxDialog()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onNewReactContextCreated(reactContext: ReactContext)
abstract fun onNewReactContextCreated(reactContext: ReactContext)
Link copied to clipboard
open fun onReactInstanceDestroyed(reactContext: ReactContext)
abstract fun onReactInstanceDestroyed(reactContext: ReactContext)
Link copied to clipboard
open fun openDebugger()
Attempt to open the JS debugger on the host machine.
abstract fun openDebugger()

Attempt to open the JS debugger on the host machine.

Link copied to clipboard
open fun registerErrorCustomizer(errorCustomizer: ErrorCustomizer)
abstract fun registerErrorCustomizer(errorCustomizer: ErrorCustomizer)
Link copied to clipboard
open fun reloadJSFromServer(bundleURL: String, callback: BundleLoadCallback)
abstract fun reloadJSFromServer(bundleURL: String, callback: BundleLoadCallback)
Link copied to clipboard
open fun reloadSettings()
abstract fun reloadSettings()
Link copied to clipboard
Add an option to send to packager when requesting JS bundle.
abstract fun setAdditionalOptionForPackager(name: String, value: String)

Add an option to send to packager when requesting JS bundle.

Link copied to clipboard
open fun setDevSupportEnabled(isDevSupportEnabled: Boolean)
com.facebook.react.ReactInstanceManager is responsible for enabling/disabling dev support when a React view is attached/detached or when application state changes (e.g.
abstract fun setDevSupportEnabled(<set-?>: Boolean)
Link copied to clipboard
open fun setFpsDebugEnabled(isFpsDebugEnabled: Boolean)
abstract fun setFpsDebugEnabled(isFpsDebugEnabled: Boolean)
Link copied to clipboard
open fun setHotModuleReplacementEnabled(isHotModuleReplacementEnabled: Boolean)
abstract fun setHotModuleReplacementEnabled(isHotModuleReplacementEnabled: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun showNewJavaError(@Nullable message: String, e: Throwable)
abstract fun showNewJavaError(message: String, e: Throwable)
Link copied to clipboard
open fun showNewJSError(@Nullable message: String, @Nullable details: ReadableArray, errorCookie: Int)
abstract fun showNewJSError(message: String, details: ReadableArray, errorCookie: Int)
Link copied to clipboard
Shows the "paused in debugger" overlay with the given message.

Shows the "paused in debugger" overlay with the given message.

Link copied to clipboard
open fun startInspector()
abstract fun startInspector()
Link copied to clipboard
open fun stopInspector()
abstract fun stopInspector()
Link copied to clipboard