DLLocalNotifications icon indicating copy to clipboard operation
DLLocalNotifications copied to clipboard

Delayed notifications firing immediately

Open mibrahim025 opened this issue 2 years ago • 3 comments

Can you please fix the issue of delayed notifications firing immediately.. are you aware of that?

mibrahim025 avatar Jan 18 '22 09:01 mibrahim025

do you mind giving me a code snippet that you set up so I can look into this? Thanks

d7laungani avatar Feb 07 '22 06:02 d7laungani

Hi @d7laungani , so, assuming you create a notification that repeats every day, I think the date components would look like this:

calendar.components([.hour, .minute], from: date)

Even if this date is a date from next month, the notification will start to get fired from tomorrow (or even today if the current time is before the specified hour) because the day info gets cut off by the date components.

In order for it to work properly, you'd have to do some complicated tricks like, create a non-repeating notification for next month first and then create another repeating one for after the firing date.

I know it's stupid and Apple should really do something about it, but it has been that way for many years now. Unless that is taken care of, I honestly don't feel much benefit to use this library.

higalex avatar Feb 12 '22 16:02 higalex

Sorry for late reply. Thanks for your explanation and guidance. I really appreciate it. On 12 Feb 2022, 9:36 PM +0500, Izumi Higa @.***>, wrote:

Hi @d7laungani , so, assuming you create a notification that repeats every day, I think the date components would look like this: calendar.components([.hour, .minute], from: date) Even if this date is a date from next month, the notification will start to get fired from tomorrow (or even today if the current time is before the specified hour) because the day info gets cut off by the date components. In order for it to work properly, you'd have to do some complicated tricks like, create a non-repeating notification for next month first and then create another repeating one for after the firing date. I know it's stupid and Apple should really do something about it, but it has been that way for many years now. Unless that is taken care of, I honestly don't feel much benefit to use this library. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

mibrahim025 avatar Mar 16 '22 14:03 mibrahim025