1

I am using awesome_notifications package in my flutter application to show notifications and I am triggering my notifications using firebase_messaging , so whenever firebase cloud messaging is triggered I get notification on my device. The ISSUE I am facing is as below :-

ISSUE - Action Buttons are being displayed in my notification when the application is in background mode on my Emulator(Android Studio Emulator) BUT when I run the same application on a real device and I put application in background and trigger a notification using firebase I do get the notification but ACTION BUTTONS ARE NOT DISPLAYED. I am stuck with this issue if someone can please help.

IMPLEMENTATION - I am calling AwesomeNotifications().createNotification() function inside FirebaseMessaging.onBackgroundMessage() function. to show notification even when my application is in background .

I would really appreciate all the help

I have searched online for all the possible solutions but still facing the same issues, I have also tried using the awesome_notifications_fcm package but it was of no help too.

Byte Ninja
  • 881
  • 5
  • 13

1 Answers1

1

Have you tried setting actionType in NotificationContent to SilentBackgroundAction like below?

AwesomeNotifications().createNotification(
  content: NotificationContent(
    id: 1,
    channelKey: "some-key",
    actionType: ActionType.SilentBackgroundAction,
  ),
);

As it says in documentation "Do not forces the app to go foreground and runs on an exclusive dart isolate and do not accept any visual element. The execution is totally apart from app lifecycle and will not be interrupt if the app goes terminated / killed."

cryndry
  • 39
  • 7