Closed yaro-melnychuk closed 9 months ago
Hi @yaro-melnychuk
Thank you for sharing this issue.
I was able to reproduce your issue. It was caused by an integer overflow of the variable that stored the alarm delay in milliseconds. I just released a fix in version 3.0.6
.
Please let me know if it fixes your issue.
worked, thank you so much
Awesome. I'm closing the issue then.
Awesome. I'm closing the issue then.
I want to reopen this as I encounter this in version 3.0.8
@kydoaod
Sure, it's reopened. What is the duration you gave ?
@kydoaod
Sure, it's reopened. What is the duration you gave ?
@gdelataillade I did try 1min from now, 7hours from now and 1hour from now but regardless, the outcome is the same. Bug is still there
@kydoaod
Your alarm rings immediately regardless of the date time too ?
Do you have error logs ?
@kydoaod
Your alarm rings immediately regardless of the date time too ?
Do you have error logs ?
@gdelataillade
Yes but it does not have any error logs. Its just that the alarm trigger was wrong. By the way, I am using this package as well https://pub.dev/packages/flutter_background_service to overcome the issue about when the app was killed, it wont trigger alarm anymore. And also this package https://pub.dev/packages/awesome_notifications for other matters. Will that be helpful?
@kydoaod
Is your device date time settings are correct ? I wonder if the error could happen if you changed it manually.
Alarm are supposed to ring even when app was killed (Android only).
@kydoaod
Is your device date time settings are correct ? I wonder if the error could happen if you changed it manually.
Alarm are supposed to ring even when app was killed (Android only).
@gdelataillade I think I found out what happened. So as I am trying to scheduled something periodically in our own code, there was a part there that stores the the alarm schedule in our code and it accidentally placing previous dates which probably resulted into this. It was quite confusing because even if thats the case, it should have never trigger the alarm at all right? But with some fixes, I think should be good on happy path
Hi @kydoaod
I make alarms with date times in the past ring, to handle the case where an alarm did not trigger for some reason so it can still ring later, when it gets possible.
OK, so I'll let you fix your code. I'm closing this issue again. Send a message here for any other question, I'll see it.
Alarm plugin version 3.0.5
Describe the bug On Android devices, when setting the alarm
dateTime
for more than 1 month after the current date, the alarm starts immediately. (Should start in 1 month)To Reproduce to reproduce on the example app replace this line with something like this
dateTime: selectedDateTime.add(const Duration(days: 40)),
Expected behavior The alarm should ring after 40 days but rings immediately.
Device info Android only