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).
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
)
]
);
© 2022 - 2024 — McMap. All rights reserved.