IReactModuleBuilder
Builds native modules inside of React native code based on the provided meta-data. See Native Modules for more usage information.
Reference
Methods
AddInitializer()
void AddInitializer(InitializerDelegate initializer);
An initializer is a method that will be called when the react instance starts. It provides the native module with the IReactContext for the running instance. See InitializerDelegate.
AddConstantProvider()
void AddConstantProvider(ConstantProviderDelegate constantProvider);
The JSValue written by the ConstantProviderDelegate will be available as constants on the native module is JavaScript.
AddMethod()
void AddMethod(String name, MethodReturnType returnType, MethodDelegate method);
The valid values for MethodReturnType
are:
enum MethodReturnType {
Void,
Callback,
TwoCallbacks,
Promise,
};
See MethodDelegate.
AddSyncMethod()
void AddSyncMethod(String name, SyncMethodDelegate method);
Adds a synchronous method to the NativeModule. See SyncMethodDelegate.
Delegates
InitializerDelegate
delegate void InitializerDelegate(IReactContext reactContext);
A delegate that will set reactContext for a module. We use it for a stand-alone initialize method, strongly typed JS events and functions.
MethodResultCallback
delegate void MethodResultCallback(IJSValueWriter outputWriter);
A callback to call JS code with results.
MethodDelegate
delegate void MethodDelegate(IJSValueReader inputReader, IJSValueWriter outputWriter, MethodResultCallback resolve, MethodResultCallback reject);
A delegate to call native asynchronous method.
SyncMethodDelegate
delegate void SyncMethodDelegate(IJSValueReader inputReader, IJSValueWriter outputWriter);
A delegate to call native synchronous method.
ConstantProviderDelegate
delegate void ConstantProviderDelegate(IJSValueWriter constantWriter);
A delegate to gather constants from native modules.