Closed jeespu closed 4 months ago
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
I need a functionality for an app I'm working on, where the user can set a reminder for time X and it can be configured to repeat every N {timeUnit}, so for example every 3 hours. I've been testing and trying stuff for a few days now without any luck to get it reliably working.
So far I've managed to get the events to trigger when I initially create a timestamp notification, and add a onBackgroundEvent handler that will schedule a new trigger notification. In the event handler, I filter out "DELIVERED" events and once the notification is delivered, I schedule another one.
My problems are, the event handler seems to run multiple times and always triggers events 3, 7, 3, 7, 3, 7 (3 being DELIVERED and 7 being TRIGGER_NOTIFICATION_CREATED or something). In addition to this, the newly scheduled "follow-up notification" always seems to schedule a new notification as it should, but it never fires, even when the app is in the foreground.
Using the interval trigger alone is not sufficient for the app because it doesn't allow setting a custom start time, but neither is using a timestamp trigger's RepeatFrequency, because it doesn't allow custom intervals. The app already had a functionality like this that uses react-native-push-notification, but the library is sadly very outdated and we'd like to replace it with a newer one that is maintained.
@helenaford any insight on this? Also, does iOS send "DELIVERED" events yet? Is there any reliable workaround for the case I described?
EDIT: I noticed I had forgot to set channelId for the new notification and the notification now popped. I also added a 2 second timeout for the event handler and the "looping" stopped. Hacky, but works. The question remains: will this work for iOS?