-
public class ReactInstanceManagerBuilder
Builder class for ReactInstanceManager
-
-
Method Summary
-
-
Method Detail
-
setUIImplementationProvider
ReactInstanceManagerBuilder setUIImplementationProvider(@Nullable() UIImplementationProvider uiImplementationProvider)
Sets a provider of UIImplementation. Uses default provider if null is passed.
-
setJSIModulesPackage
ReactInstanceManagerBuilder setJSIModulesPackage(@Nullable() JSIModulePackage jsiModulePackage)
-
setJavaScriptExecutorFactory
ReactInstanceManagerBuilder setJavaScriptExecutorFactory(@Nullable() JavaScriptExecutorFactory javaScriptExecutorFactory)
Factory for desired implementation of JavaScriptExecutor.
-
setBundleAssetName
ReactInstanceManagerBuilder setBundleAssetName(String bundleAssetName)
Name of the JS bundle file to be loaded from application's raw assets. Example:
{@code * "index.android.js"}
-
setJSBundleFile
ReactInstanceManagerBuilder setJSBundleFile(String jsBundleFile)
Path to the JS bundle file to be loaded from the file system.
Example:
{@code "assets://index.android.js" or "/sdcard/main.jsbundle"}
-
setJSBundleLoader
ReactInstanceManagerBuilder setJSBundleLoader(JSBundleLoader jsBundleLoader)
Bundle loader to use when setting up JS environment. This supersedes prior invocations of setJSBundleFile and setBundleAssetName.
Example:
{@code JSBundleLoader.createFileLoader(application, bundleFile)}
-
setJSMainModulePath
ReactInstanceManagerBuilder setJSMainModulePath(String jsMainModulePath)
Path to your app's main module on Metro. This is used when reloading JS during development. Allpaths are relative to the root folder the packager is serving files from. Examples:
{@code * "index.android"}
or{@code "subdirectory/index.android"}
-
addPackage
ReactInstanceManagerBuilder addPackage(ReactPackage reactPackage)
-
addPackages
ReactInstanceManagerBuilder addPackages(List<ReactPackage> reactPackages)
-
setBridgeIdleDebugListener
ReactInstanceManagerBuilder setBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener)
-
setApplication
ReactInstanceManagerBuilder setApplication(Application application)
Required. This must be your
{@code Application}
instance.
-
setCurrentActivity
ReactInstanceManagerBuilder setCurrentActivity(Activity activity)
-
setDefaultHardwareBackBtnHandler
ReactInstanceManagerBuilder setDefaultHardwareBackBtnHandler(DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler)
-
setUseDeveloperSupport
ReactInstanceManagerBuilder setUseDeveloperSupport(boolean useDeveloperSupport)
When
{@code true}
, developer options such as JS reloading and debugging are enabled. Note youstill have to call showDevOptionsDialog to show the dev menu, e.g. when the deviceMenu button is pressed.
-
setDevSupportManagerFactory
ReactInstanceManagerBuilder setDevSupportManagerFactory(DevSupportManagerFactory devSupportManagerFactory)
Set the custom DevSupportManagerFactory. If not set, will use .
-
setRequireActivity
ReactInstanceManagerBuilder setRequireActivity(boolean requireActivity)
When
{@code false}
, indicates that correct usage of React Native will NOT involve an Activity.For the vast majority of Android apps in the ecosystem, this will not need to change. Unlessyou really know what you're doing, you should probably not change this!
-
setSurfaceDelegateFactory
ReactInstanceManagerBuilder setSurfaceDelegateFactory(@Nullable() SurfaceDelegateFactory surfaceDelegateFactory)
When the SurfaceDelegateFactory is provided, it will be used for native modules to geta SurfaceDelegate to interact with the platform specific surface that they that needsto be rendered in. For mobile platform this is default to be null so that these modules willneed to provide a default surface delegate. One example of such native module is LogBoxModule,which is rendered in mobile platform with LogBoxDialog, while in VR platform with custom layerprovided by runtime.
-
setInitialLifecycleState
ReactInstanceManagerBuilder setInitialLifecycleState(LifecycleState initialLifecycleState)
Sets the initial lifecycle state of the host. For example, if the host is already resumed atcreation time, we wouldn't expect an onResume call until we get an onPause call.
-
setNativeModuleCallExceptionHandler
ReactInstanceManagerBuilder setNativeModuleCallExceptionHandler(NativeModuleCallExceptionHandler handler)
Set the exception handler for all native module calls. If not set, the default will be used, which shows a redbox in dev mode and rethrows (crashes theapp) in prod mode.
-
setRedBoxHandler
ReactInstanceManagerBuilder setRedBoxHandler(@Nullable() RedBoxHandler redBoxHandler)
-
setLazyViewManagersEnabled
ReactInstanceManagerBuilder setLazyViewManagersEnabled(boolean lazyViewManagersEnabled)
-
setDevBundleDownloadListener
ReactInstanceManagerBuilder setDevBundleDownloadListener(@Nullable() DevBundleDownloadListener listener)
-
setMinNumShakes
ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes)
-
setMinTimeLeftInFrameForNonBatchedOperationMs
ReactInstanceManagerBuilder setMinTimeLeftInFrameForNonBatchedOperationMs(int minTimeLeftInFrameForNonBatchedOperationMs)
-
setCustomPackagerCommandHandlers
ReactInstanceManagerBuilder setCustomPackagerCommandHandlers(Map<String, RequestHandler> customPackagerCommandHandlers)
-
setReactPackageTurboModuleManagerDelegateBuilder
ReactInstanceManagerBuilder setReactPackageTurboModuleManagerDelegateBuilder(@Nullable() ReactPackageTurboModuleManagerDelegate.Builder builder)
-
build
ReactInstanceManager build()
Instantiates a new ReactInstanceManager. Before calling
{@code build}
, the followingmust be called:- setApplication
- setCurrentActivity if the activity has already resumed
- setDefaultHardwareBackBtnHandler if the activity has already resumed
- setJSBundleFile or setJSMainModulePath
-
-
-
-