null is not an object (evaluating 'RNBatch.NOTIFICATION_TYPES')
I'm trying to set up react-native-batch-push in my project.
So far I've followed all the steps in the installation guide and I made it work on iOS.
However, on Android, every time I try to import Batch or BatchPush in my code like this:
import { BatchPush, Batch } from "@bam.tech/react-native-batch";
I get an error on Android only:

So when I go to node_modules/@bam.tech/react-native-batch/dist/BatchPush.js I see this
const RNBatch = react_native_1.NativeModules.RNBatch; exports.AndroidNotificationTypes = RNBatch.NOTIFICATION_TYPES; So, is somehow the native module not being imported correctly? Do I need to follow extra steps for this to work?
@bam.tech/react-native-batch is being used with version 5.2.1 npm version 6.14.7 react-native version 0.60.5
+1
Update: it turns out that the package was not linked correctly and that I had to manually add the package in MainApplication.java (I don't really know why react-native link did not do this automatically)
Add the import:
import tech.bam.RNBatchPush.RNBatchPackage;
And then add
new RNBatchPackage(), in the getPackages() method.
I think it's safe to close the issue now!