gdelataillade/alarm

Notification not showing while Alarm ring

Riyaz7364 opened this issue · 4 comments

Alarm plugin version
3.1.3

Describe the bug
Notification not showing on the screen while Alarm trigger. To stop the Alarm I have to force store the app. There must be a stop button and also when I set the alarm again while is running current alarm will stop, I think there must be a button to store the alarm then set another alarm

Expected behavior
There must be a notification which show with title and body and the bottom to stop the alarm and stop must have a trigger to callback funtion

Device info
Samsung a23, Android 13

Hi @Riyaz7364

To stop the alarm you have to call the Alarm.stop method. In the future when I'll find the time I'll add a stop button to the notification: #58
When you set an alarm with the same id as an existing one, it will stop the existing one and replace it with the new one. If you want to manage your alarms separately, you need to use different ids.

Am I answering your questions ?

No actually i have this error tooo there is no notification when it rings

Hi @CntrlX

Your notifications never show ? Make sure you asked for the notification permission. See permission_handler.

@Riyaz7364 @CntrlX
If you're using alarm package with flutter_local_notifications package, in my case, I had to write the code in the following order to make it work properly in main.dart. Just in case!

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await FlutterLocalNotificationsPlugin().initialize(settings: ...);

  await Alarm.init();
}