I am 100% new to Java and I'm trying to add Crashlytics to my React Native project. The only code snippet I could find on the internet is retrolambda syntax.
I realize I could add that particular "library" or whatever, so it works, but considering it's the only place used in my project I'd rather just convert it to the 'older format' rather than adding a library just to do one function.
public final class AppReactPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
addExceptionHandler(reactContext);
}
private void addExceptionHandler(ReactApplicationContext reactContext) {
// Fyi, this is using Retrolambda for Java 8 syntax
reactContext.setNativeModuleCallExceptionHandler(e -> {
if (e instanceof JavascriptException) {
Crashlytics.log(e.getMessage());
} else {
Crashlytics.logException(e);
}
});
}
}