ReactDelegate

open class ReactDelegate

A delegate for handling React Application support. This delegate is unaware whether it is used in an Activity or a android.app.Fragment.

Constructors

Link copied to clipboard
constructor(activity: Activity, reactNativeHost: ReactNativeHost, @Nullable appKey: String, @Nullable launchOptions: Bundle)
Do not use this constructor as it's not accounting for New Architecture at all.
constructor(activity: Activity, reactHost: ReactHost, @Nullable appKey: String, @Nullable launchOptions: Bundle)
constructor(activity: Activity, reactNativeHost: ReactNativeHost, @Nullable appKey: String, @Nullable launchOptions: Bundle, fabricEnabled: Boolean)

Functions

Link copied to clipboard
Get the current ReactContext from ReactHost or ReactInstanceManager Do not store a reference to this, if the React instance is reloaded or destroyed, this context will no longer be valid.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun loadApp()
Start the React surface with the app key supplied in the ReactDelegate constructor.
open fun loadApp(appKey: String)
Start the React surface for the given app key.
Link copied to clipboard
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent, shouldForwardToReactInstance: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onHostDestroy()
Link copied to clipboard
open fun onHostPause()
Link copied to clipboard
open fun onHostResume()
Link copied to clipboard
open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean
Link copied to clipboard
open fun onKeyLongPress(keyCode: Int): Boolean
Link copied to clipboard
open fun onNewIntent(intent: Intent): Boolean
Link copied to clipboard
open fun onUserLeaveHint()
Link copied to clipboard
open fun onWindowFocusChanged(hasFocus: Boolean)
Link copied to clipboard
open fun reload()
Link copied to clipboard
open fun setReactRootView(reactRootView: ReactRootView)
Link copied to clipboard
open fun setReactSurface(reactSurface: ReactSurface)
Link copied to clipboard
open fun shouldShowDevMenuOrReload(keyCode: Int, event: KeyEvent): Boolean
Handles delegating the onKeyUp method to determine whether the application should show the developer menu or should reload the React Application.
Link copied to clipboard
open fun unloadApp()
Stop the React surface started with loadApp.