react native push notification snooze (react-native-push-notification)

Viewed 130

I'm using https://github.com/zo0r/react-native-push-notification for local push notifications. It also includes an option to have some buttons on the notification("actions"), which I can press on.

However, when I'm getting a notification, to respond 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 myself.

This is the process I wish to have:

  1. Push notification is showing up
  2. The user clicks on the snooze button(same as an alarm)
  3. The application is still in the background
  4. The notification will be pushed again after some time.

What is the proper way to do such a thing? I have to run a background task that is fired when the user presses the snooze button. How can I use HeadlessJS for this? It is very easy to implement the snoozing logic with JavaScript, the problem is to fire it.

0 Answers
Related