Stop with alarm with WorkManager on iOS
Opened this issue · 3 comments
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:
- Set an alarm using the alarm plugin.
- Wait for the alarm to start.
- 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.
When iOS app is terminated the alarm won't ring. Only the notification will show.
When iOS app is terminated the alarm won't ring. Only the notification will show.
Ok thanks, and what about foreground and background states
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.