createInteractiveNotification method
NotificationPayload
createInteractiveNotification({
- required String id,
- required String title,
- required String body,
- required List<
NotificationAction> actions, - Map<
String, dynamic> ? data, - String? imageUrl,
- NotificationImportance importance = NotificationImportance.high,
Creates an interactive notification with action buttons.
Implementation
NotificationPayload createInteractiveNotification({
required String id,
required String title,
required String body,
required List<NotificationAction> actions,
Map<String, dynamic>? data,
String? imageUrl,
NotificationImportance importance = NotificationImportance.high,
}) {
return NotificationPayload(
id: id,
title: title,
body: body,
data: data ?? <String, dynamic>{},
imageUrl: imageUrl,
actions: actions,
importance: importance,
priority: NotificationPriority.high,
autoCancel: false, // Keep notification until user interacts
);
}