-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Invariant Violation: new NativeEventEmitter() requires a non-null argument #2420
Description
I am encountering an issue with react-native-push-notification. Despite following the installation and configuration steps, I get the following error when running my React Native app:
ERROR Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes
-
Steps to Reproduce:
Install react-native-push-notification : npm install --save react-native-push-notification -
Configure react-native-push-notification in the project:
`import PushNotification from "react-native-push-notification";
PushNotification.configure({
onRegister: function (token) {
console.log("TOKEN:", token);
},
onNotification: function (notification) {
console.log("NOTIFICATION:", notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});`
- Run the app on iOS using Xcode.
Expected Behavior
The app should run without errors and handle push notifications as configured.
Actual Behavior
The app crashes with the error:
Invariant Violation: new NativeEventEmitter() requires a non-null argument.
Environment
React Native version: 0.73.6
react-native-push-notification version: 8.1.1
Platform: iOS
Hermes: true