createInteractiveNotification method

NotificationPayload createInteractiveNotification({
  1. required String id,
  2. required String title,
  3. required String body,
  4. required List<NotificationAction> actions,
  5. Map<String, dynamic>? data,
  6. String? imageUrl,
  7. 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
  );
}