From a8934da43ac497f28a57e29cf7563d215b588545 Mon Sep 17 00:00:00 2001 From: cyberpwn Date: Sun, 13 Apr 2025 00:45:37 -0400 Subject: [PATCH 1/2] Interruption Level for APS --- .../lib/src/messaging/messaging_api.dart | 6 ++++++ 1 file changed, 6 insertions(+) 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..e703112 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,7 @@ class Aps { this.mutableContent, this.category, this.threadId, + this.interruptionLevel, }); /// Alert to be included in the message. This may be a string or an object of @@ -478,6 +479,10 @@ 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; + Map _toProto() { return { if (alert != null) 'alert': alert?._toProto(), @@ -487,6 +492,7 @@ class Aps { if (mutableContent != null) 'mutable-content': mutableContent, if (category != null) 'category': category, if (threadId != null) 'thread-id': threadId, + if (interruptionLevel != null) 'interruption-level': interruptionLevel, }._cleanProto(); } } From b4367b269549e0ec9769aed5c17229d45fde7725 Mon Sep 17 00:00:00 2001 From: cyberpwn Date: Sun, 13 Apr 2025 00:57:16 -0400 Subject: [PATCH 2/2] Sound Raw --- .../lib/src/messaging/messaging_api.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 e703112..59f8f58 100644 --- a/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart +++ b/packages/dart_firebase_admin/lib/src/messaging/messaging_api.dart @@ -453,6 +453,7 @@ class Aps { this.category, this.threadId, this.interruptionLevel, + this.soundRaw, }); /// Alert to be included in the message. This may be a string or an object of @@ -483,11 +484,15 @@ class Aps { /// 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,