Skip to content

Commit 9f36bdd

Browse files
committed
chore: Implement cpp-adapter change to new initialize API (optional)
This is fully optional, but recommended for more flexibility for custom JNI registrations if needed.
1 parent 2f3fe91 commit 9f36bdd

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include <jni.h>
2+
#include <fbjni/fbjni.h>
23
#include "NitroImageOnLoad.hpp"
34

45
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
5-
return margelo::nitro::image::initialize(vm);
6+
return facebook::jni::initialize(vm, []() {
7+
margelo::nitro::image::registerAllNatives();
8+
});
69
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include <jni.h>
2+
#include <fbjni/fbjni.h>
23
#include "NitroWebImageOnLoad.hpp"
34

45
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
5-
return margelo::nitro::web::image::initialize(vm);
6+
return facebook::jni::initialize(vm, []() {
7+
margelo::nitro::image::web::registerAllNatives();
8+
});
69
}

0 commit comments

Comments
 (0)