invertase / react-native-notifee

Moved to https://github.com/invertase/notifee
https://invertase.io/blog/open-sourcing-notifee
Other
466 stars 31 forks source link

Recurring weekly notifications for the future will trigger one week early if set to >1 week in the future #289

Closed kttien closed 3 years ago

kttien commented 3 years ago

I have a similar issue to the one discussed here but for the weekly repeating frequency when trying to use the suggested workaround. Ultimately, I need to schedule a daily notification to begin more than 24 hours from now. We're already aware of the iOS bug that causes a daily notification scheduled for tomorrow to fire early at the same time on the current day. The suggested workaround was to create multiple weekly notifications starting with tomorrow. However, I've found the same early firing pattern for this solution. For example, if the current time is 10AM Monday and I'm trying to create a weekly notification to start next Monday at 11AM, it will still fire today at 11AM. Are there any suggested solutions to this?


const date = new Date(Date.now());
date.setHours(11);
date.setMinutes(0);
date.setDate(date.getDate() + 7);

const trigger: TimestampTrigger = {
  type: TriggerType.TIMESTAMP,
  timestamp: date.getTime(),
  repeatFrequency: RepeatFrequency.WEEKLY, // repeat once a week
};```
kttien commented 3 years ago

@helenaford I think you were the one helping out on the previous issue when this was first brought up. Any help would be greatly appreciated!

helenaford commented 3 years ago

Hey @kttien, I think this sounds like the similar issue to the daily one like you mentioned. I'll add a note in docs this happens for all 'RepeatFrequency' issues with iOS. Maybe you could send a remote notification to that schedule one when needed