gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
110 stars 68 forks source link

iOS App Crash when init Alarm. #209

Open iSaqibShafique opened 4 weeks ago

iSaqibShafique commented 4 weeks ago

Alarm plugin version 3.1.4

Describe the bug When I do initialize the Alarm in main() and trying running app on Simulator, it start crashing.

To Reproduce Steps to reproduce the behavior:

  1. ...

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Device info Simulator iPhone 12 mini. iOS 17.4

Additional context Add any other context about the problem here.

gdelataillade commented 4 weeks ago

Hi @iSaqibShafique

Make sure you followed the installation steps in the README. Also you should use the await keyword every time you call a method from Alarm class. Please let me know if it fixes your crash.

North101 commented 1 week ago

I am also having this happen on iOS when doing a hot reload with multiple alarms set, and also in general when multiple alarms are set in succession (with each being awaited). My fix has been to add a delay of 100ms after each Alarm.set call in my app, but I obviously can't do this within Alarm.init.