revert getConstants to avoid initialising Realm too late

This commit is contained in:
Nabil Hachicha 2016-01-12 10:25:53 +00:00
parent b246f017e9
commit 2d8dddabee
2 changed files with 5 additions and 5 deletions

View File

@ -29,13 +29,14 @@ public class RealmReactAndroid extends ReactContextBaseJavaModule {
}
@Override
public void initialize() {
Log.w("RealmReactAndroid", injectRealmJsContext(filesDirPath));
public String getName() {
return "RealmReactAndroid";
}
@Override
public String getName() {
return "RealmReactAndroid";
public Map<String, Object> getConstants() {
Log.w("RealmReactAndroid", injectRealmJsContext(filesDirPath));
return new HashMap<>();
}
@ReactMethod

View File

@ -47,7 +47,6 @@ JNIEXPORT jstring JNICALL Java_com_reacttests_RealmReactAndroid_injectRealmJsCon
for (auto pair : s_globalContextRefToJSCExecutor) {
RJSInitializeInContext(pair.first);
}
return env->NewStringUTF(msg.str().c_str());
} else {
return env->NewStringUTF("Cannot find symbol get_jsc_context");