I am also looking for a way to do this directly in C ++ without writing JNI for Android and Obj-C for iOS. I found the class CxxNativeModulein the corresponding source source. See an example implementation of SampleCxxModule .
The last thing to find out is how to register this module in C ++. In JNI for React Native Android implementation NativeModulesays
NativeModule, the implementation of which is written in C ++, should not provide any Java code (so that they can be reused on other platforms), but instead should be registered with CxxModuleWrapper.
Then the implementation CxxModuleWrappersays
This does nothing interesting except to eliminate the violation of existing code.
, . , , - CxxNativeModule, JS.