mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
Init using create-nitro-module
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
///
|
||||
/// OmniOnLoad.hpp
|
||||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
||||
/// https://github.com/mrousavy/nitro
|
||||
/// Copyright © Marc Rousavy @ Margelo
|
||||
///
|
||||
|
||||
#include <jni.h>
|
||||
#include <functional>
|
||||
#include <NitroModules/NitroDefines.hpp>
|
||||
|
||||
namespace margelo::nitro::omni {
|
||||
|
||||
[[deprecated("Use registerNatives() instead.")]]
|
||||
int initialize(JavaVM* vm);
|
||||
|
||||
/**
|
||||
* Register the native (C++) part of Omni, and autolinks all Hybrid Objects.
|
||||
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
|
||||
* inside a `facebook::jni::initialize(vm, ...)` call.
|
||||
* Example:
|
||||
* ```cpp (cpp-adapter.cpp)
|
||||
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
||||
* return facebook::jni::initialize(vm, []() {
|
||||
* // register all Omni HybridObjects
|
||||
* margelo::nitro::omni::registerNatives();
|
||||
* // any other custom registrations go here.
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
void registerAllNatives();
|
||||
|
||||
} // namespace margelo::nitro::omni
|
||||
Reference in New Issue
Block a user