diff --git a/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart b/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart index 3153962..59f8f58 100644 --- a/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart +++ b/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart @@ -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 @@ -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 _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(); } }