Android Scheduled Local Notifications Delay

I’m using Scheduled Local Notifications and finding that notifications often (though not always) get triggered later than the time that was scheduled, typically around a minute late.

I found this thread from a year ago that reports the same problem but is now closed. @gametimesapp posted a snack to that thread which demonstrates the problem quite well: https://snack.expo.io/rygk9xGLQ

Has anyone else come across this issue or know what might be causing it?

Hey @solarr,

Would you mind creating a github issue for this? The snack you linked is a little outdated so if you could create a new one running on SDK34 (or whatever supported SDK version you are experiencing it on that would be much appreciated). For reproducible bugs we prefer to track and address them on our github repo!

Cheers,
Adam

FYI the update to SDK 34 is almost trivial for that snack:

I tried it out and have a theory that the granularity for the notifications is one minute. It seems to round the time up to the following minute. So if you set the notification to 12:00:01, you’ll get it at 12:01. If you set it to 12:00:59 you’ll also get it at 12:01.
I only tested a couple of times on a Galaxy S8 running Android 9.

Thanks for the replies. @wodin that explanation makes a lot of sense. I was sure that must be it, but after playing with it some more I’m still struggling to find a pattern. I added a version of the snack with the current time to make it a little easier to judge the delay (when there is one): https://snack.expo.io/@solarr/scheduled-notification-delay.

I’ll post the link to the issue on github once I’ve raised it.

1 Like

I’ve got to admit I’m having problems replicating in the SDK34 snack now. Though I’m still having the problem in my own project after upgrading to SDK34. I haven’t raised a github issue yet but will do if I can figure out how to replicate this more reliably.

1 Like

Finally got round to raising this: https://github.com/expo/expo/issues/5799. I found it only seems to replicate consistently if a notification is pending while a another one is scheduled.

2 Likes

Thanks for doing this, @solarr!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.