Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ class Aps {
this.mutableContent,
this.category,
this.threadId,
this.interruptionLevel,
this.soundRaw,
});

/// Alert to be included in the message. This may be a string or an object of
Expand All @@ -478,15 +480,24 @@ class Aps {
/// An app-specific identifier for grouping notifications.
final String? threadId;

/// Specifies the interruption level of the notification.
/// Usually critical or time-sensitive.
final String? interruptionLevel;

/// The sound name directly inserted as "sound": "sound_name" in the payload.
final String? soundRaw;

Map<String, Object?> _toProto() {
return {
if (alert != null) 'alert': alert?._toProto(),
if (badge != null) 'badge': badge,
if (sound != null) 'sound': sound?._toProto(),
if (sound != null || soundRaw != null)
'sound': sound?._toProto() ?? soundRaw,
if (contentAvailable != null) 'content-available': contentAvailable,
if (mutableContent != null) 'mutable-content': mutableContent,
if (category != null) 'category': category,
if (threadId != null) 'thread-id': threadId,
if (interruptionLevel != null) 'interruption-level': interruptionLevel,
}._cleanProto();
}
}
Expand Down