-
public interface NativeModuleA native module whose API can be provided to JS catalyst instances. NativeModules whose implementation is written in Java should extend BaseJavaModule or . NativeModules whose implementation is written in C++ must not provide any Java code (so they can be reused on other platforms), and instead should register themselves using CxxModuleWrapper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceNativeModule.NativeMethod
-
Method Summary
Modifier and Type Method Description abstract StringgetName()abstract voidinitialize()This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules. abstract booleancanOverrideExistingModule()Return true if you intend to override some other native module that was registered e.g. abstract voidonCatalystInstanceDestroy()Allow NativeModule to clean up. abstract voidinvalidate()Allow NativeModule to clean up. -
-
Method Detail
-
initialize
abstract void initialize()
This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.
-
canOverrideExistingModule
abstract boolean canOverrideExistingModule()
Return true if you intend to override some other native module that was registered e.g. as partof a different package (such as the core one). Trying to override without returning true fromthis method is considered an error and will throw an exception during initialization. Bydefault all modules return false.
-
onCatalystInstanceDestroy
abstract void onCatalystInstanceDestroy()
Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}
-
invalidate
abstract void invalidate()
Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}
-
-
-
-