I am using Firebase Messaging to send users notifications from the cloud, but I want some notifications to have action buttons options (text input, button selections) from within the notification, so I'm using the awesome_notifications.
I have set up the package to run this method whenever an notification is received:
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await AwesomeNotifications().createNotification(
content: NotificationContent(
id: 1,
channelKey: 'basic_channel',
title: message.notification.title,
body: message.notification.body,
createdSource: NotificationSource.Firebase,
notificationLayout: NotificationLayout.BigText,
),
actionButtons: <NotificationActionButton>[
NotificationActionButton(
key: 'short_text',
label: 'Answer',
buttonType: ActionButtonType.InputField,
autoCancel: true,
),
],
);
}
This does properly generate a notification with the correct title, body, layout, and text input option, but the notification received directly from FCM is also displayed. I only want the notification that I generate with awesome_notifications to be shown but I can't seem to find a way to do this. Thanks for any input.