i've been able to show Local Notification but is there any option to show buttons below the notification?
(See "Snooze" & "Dismiss" button in the attached picture).
If you are using local_notifications you can add actions
:
handleCustomActionClick(String payload) {
if(payload == "secondAction") {
LocalNotifications.removeNotification(0);
}
}
int id = await LocalNotifications.createNotification(
title: "Multiple Actions",
content: 'With custom callbacks',
id: 0,
onNotificationClick: new NotificationAction(
actionText: "Some action",
callback: onNotificationClick,
payload: "Some payload",
launchesApp: false
),
actions: [
new NotificationAction(
actionText: "First",
callback: handleCustomActionClick,
payload: "firstAction",
launchesApp: true
),
new NotificationAction(
actionText: "Second",
callback: handleCustomActionClick,
payload: "secondAction",
launchesApp: false
)
]
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With