I've followed the documentation, added actions property to notification data. Also added listener for notificationActionReceived. Everything works fine... when app is running (either in foreground or background). But when it is not active (eg. was stopped/killed by user) tapping on notification action doesn't work.
In such case notification stays in place and nothing happen. It is not dismissed nor executed.
Do I missing something eg. in AndroidManifest or another listener?
/cc @varungupta85
Same issue
You can try my PR (https://github.com/zo0r/react-native-push-notification/pull/632), it fixes this issue.
BTW. Read through readme first, it requires some modifications in app code.
@dluksza So you were able to get notfications (not actions) to show when app was killed? I am able to get notifications to show when app is running/background but not when it was killed. Can you please document your config and the notification message? TIA.
Yes, I'm getting notifications on Android when app is not running. The data structure (aka message configuration) that I'm passing to PushNotification.localNotification function, has number property set to a "1" (yes, this is a number within a string). Don't remember exactly what this was fixing, but for sure I had some issues with notifications working properly.
@dluksza can you show example how you get notifications when app is not running? I'm get notification only when app is running.
@dluksza I second this. I also encounter this issue. When app is in background, push notifications are triggered. However, when it is forced closed and killed. It is not coming anymore. Can you elaborate more on the fix you found?
@adirzoari, @vvavepacket have a look into the readme file of my fork https://github.com/dluksza/react-native-push-notification/#notification-actions
BTW. I've reimplemented this feature in react-native-firebase where it was merged and has a decent documentation how to use it https://rnfirebase.io/docs/v4.2.x/notifications/android-actions
The key in both cases is the exported service that listens for incoming actions from the notification.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
You can try my PR (https://github.com/zo0r/react-native-push-notification/pull/632), it fixes this issue.
BTW. Read through readme first, it requires some modifications in app code.