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

Action buttons (dismiss, snooze) #211

Closed ShadichyDev closed 3 weeks ago

ShadichyDev commented 3 weeks ago

Is your feature request related to a problem? Please describe. There's no dismiss button and I can't swipe the notification away

Describe the solution you'd like Add snoozeActionLabel and dismissActionLabel at least

Describe alternatives you've considered I have to press power button to stop ringing /vibrating

Additional context Android 12, api level 31

Screenshot_20240604-164749

gdelataillade commented 3 weeks ago

Hi @ShadichyDev,

The alarm plugin uses Android’s Foreground Service to ensure the alarm can trigger at any time, even if the app is killed. However, this requires making the notification non-dismissible for Android 12+ due to Android’s rules.

Regarding notification action buttons (stop & snooze), they are on my to-do list. However, as I mostly work alone on the plugin and have limited time, it may take a while to implement.

I am closing this issue as it is a duplicate of issue #58. I will keep you updated there.

ShadichyDev commented 3 weeks ago

I did not get the term "non-dismissible". Isn't it just invoke 'stopAlarm' when presssing Dismiss button if present?

gdelataillade commented 3 weeks ago

When I said "non-dismissible" I meant that you can't swipe away the notification. But yes, when I'll add notification action buttons, it will call stopAlarm. But it's not that simple because I will have to do it native-side, that's where I manage the notifications. I also have to update the local storage. Let me know if you have any question.