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

in Android 13 notification can't clear from alarm package #212

Closed careconnect278 closed 3 weeks ago

careconnect278 commented 3 weeks ago

Alarm plugin version 3.1.4

Describe the bug in Android 13 notification can't clear

Expected behavior notification can clear.

https://github.com/gdelataillade/alarm/assets/166753700/fba99216-233e-4afd-bedb-552af3b5c955

Device info Provide device info (Manufacturer, OS version, ...) *Ex: oneplus nord 2,oppo reno 6,samsung m52 android 13

gdelataillade commented 3 weeks ago

Hi @careconnect278

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

Foreground services must display a notification, and on Android 12 and later, these notifications cannot be dismissed by the user if the service is intended to run indefinitely. This is to ensure that the user is always aware of any ongoing processes that might affect battery life or device performance.

careconnect278 commented 3 weeks ago

is there any solution for this ,some times alarm ringing in inappropriate time,some times only,there have 1 ,2,3,4 or 5 minutes difference

gdelataillade commented 3 weeks ago

Please make sure you carefully followed the installation steps in the README.