react-native-notifications icon indicating copy to clipboard operation
react-native-notifications copied to clipboard

registerNotificationReceivedBackground listener not triggered on Android when App is in background

Open gentlee opened this issue 8 months ago • 1 comments

There are several stale tickets for that like:

  • https://github.com/wix/react-native-notifications/issues/883
  • https://github.com/wix/react-native-notifications/issues/905

But it is still happening. Is this repo dead or what?

gentlee avatar Apr 14 '25 16:04 gentlee

From what I have learned so far:

THIS LIBRARY DOESN'T SUPPORT HANDLING BACKGROUND NOTIFICATIONS FROM JS ON ANDROID WHEN APP IS CLOSED

More details

  1. Android restricted starting activities from background at some point.
  2. This lib doesn't use Headless Js to run JS code in background, so background handler will never run when app closed, because activity that launches RN is not started.

This library needs update to support that.

How to fix for now:

Use @react-native-firebase/messaging lib that uses Headless Js and can handle background messages.

gentlee avatar Apr 16 '25 07:04 gentlee

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jun 26 '25 18:06 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Jul 18 '25 18:07 stale[bot]