gdelataillade / alarm

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

Stop with alarm with WorkManager on iOS #219

Open muhammedelsepa3y opened 4 months ago

muhammedelsepa3y commented 4 months ago

Alarm plugin version 3.1.4

Describe the bug When the alarm starts on iOS, it cannot be stopped until the user powers off the phone or the alarm sound ends.

To Reproduce Steps to reproduce the behavior:

  1. Set an alarm using the alarm plugin.
  2. Wait for the alarm to start.
  3. Attempt to stop the alarm.

Expected behavior The user should be able to stop the alarm using the app or physical device buttons (e.g., volume button or flipping the phone).

Screenshots None

Device info iPhone XR, iOS 17.2

Additional context In the Android version, I solved this problem using WorkManager to create tasks that allow tracking the volume button and flipping the phone to stop the alarm with the same schedule time in the alarm package. This solution works in all cases (app terminated, in background, and in foreground). However, WorkManager is not functioning as expected on iOS. I need a solution that allows the client to stop the alarm, even if it requires a native implementation. Any help to achieve this task would be appreciated.

gdelataillade commented 4 months ago

Hi @muhammedelsepa3y

When iOS app is terminated the alarm won't ring. Only the notification will show.

muhammedelsepa3y commented 4 months ago

Hi @muhammedelsepa3y

When iOS app is terminated the alarm won't ring. Only the notification will show.

Ok thanks, and what about foreground and background states

gdelataillade commented 4 months ago

Ok thanks, and what about foreground and background states

I don't know about foreground and background states, I'll have to do some research but to be honest it's not the priority at the moment. I'm working alone on the plugin and it's a lot of work.