I'm using https://github.com/zo0r/react-native-push-notification for local push notifications. It also includes an options to have some buttons on the notification("actions"), which I can press on.
However, when I'm getting a notification, in order to have a response to that button(noti. action), the app should open(the only way I could work it around) and only then I can run my logic according to the action.
Because I have some troubles using react-native-push-notification for this(It simply doesn't work), I would like to implement this by my self.
This is the process I wish to have:
- Push notification is showing up
- The user clicks on snooze button(same like an alarm)
- The application is still at background
- The notification will be pushed again after some time.
What is the proper way to do such a thing? It seems that I have to run a background task which is fired when the user presses the snooze button. How can I use HeadlessJS for this? It is very to easy to implement the snoozing logic with JavaScript, the problem is to fire it.