-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG | MISSING] - No example scenario available to demonstrate how to dismiss a notification via action button. #2519
Comments
This is a notification details used for android, i dont see any problem here. But the dismiss button is not working. Package v18.0.1 AndroidNotificationDetails(
'notifications_channel',
'Notifications',
importance: Importance.max,
priority: Priority.high,
color: MBXPalette.primary100,
icon: '@mipmap/ic_notification',
styleInformation: notifType.contains('banner')
? banner == null
? null
: BigPictureStyleInformation(
ByteArrayAndroidBitmap.fromBase64String(banner))
: BigTextStyleInformation(
notificationData['body'].toString(),
),
largeIcon: largeIcon == null
? null
: ByteArrayAndroidBitmap.fromBase64String(largeIcon),
ongoing: notificationData['is_sticky'] == 'True',
actions: [
if (notificationData['is_sticky'] == 'True')
AndroidNotificationAction(
'dismiss_action',
'Dismiss',
),
if (notificationData['primary_cta_title'] != null)
AndroidNotificationAction(
'primary_action',
notificationData['primary_cta_title'],
showsUserInterface: true,
cancelNotification: false,
),
],
) |
I do see that you've let
|
Yes
onDidReceiveNotificationResponse: (details) {
if (details.actionId == 'dismiss_action') {
FlutterLocalNotificationsPlugin().cancel(details.id!);
}
},
onDidReceiveBackgroundNotificationResponse: (details) {
if (details.actionId == 'dismiss_action') {
FlutterLocalNotificationsPlugin().cancel(details.id!);
}
}, Tapping on notification body, dismiss it. But action buttons are not working as intended. In the example project, i did not see callback are being used to cancel the notification. I think in the latest release there must be some bug. |
Originally posted by @Levi-Lesches in #1991
The text was updated successfully, but these errors were encountered: