react-native-notifications: When the app is on the background, the "registerNotificationReceivedBackground" event is not fired

Using the last version, 3.1.1, when the app is on the background, the registerNotificationReceivedBackground event is not fired.

The documentation says it’s supported but it’s not working (https://wix.github.io/react-native-notifications/docs/general-events#registernotificationreceivedbackground)

Notifications.events().registerNotificationReceivedBackground(
  (
    notification: Notification,
    completion: (response: NotificationCompletion) => void,
  ) => {
    console.log('Notification Received - Background', notification.payload);

    // Calling completion on iOS with `alert: true` will present the native iOS inApp notification.
    completion({
      alert: false,
      sound: false,
      badge: false,
    });
  },
);

Besides this, the registerNotificationReceivedForeground event is working as expected.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16

Most upvoted comments

@Moreno97 any updates ? this still seems to not work as intended

any updates ?

For background push notifications (not cold start) this worked for me 445

Hello @mikaarefyev, it’s not working when the app is killed by the user. No events fired (though the notification is received correctly).

I checked in native code and seems guys didn’t implement this method