From 1f9241168be86416dbc9f56a8efcf0b3c260ca8b Mon Sep 17 00:00:00 2001 From: emawby Date: Wed, 15 Sep 2021 15:25:56 -0700 Subject: [PATCH] adding relevanceScore and interruptionLevel to Notification.dart --- ios/onesignal_flutter.podspec | 2 +- lib/src/notification.dart | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ios/onesignal_flutter.podspec b/ios/onesignal_flutter.podspec index ce02f242..83c98217 100644 --- a/ios/onesignal_flutter.podspec +++ b/ios/onesignal_flutter.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'OneSignalXCFramework', '3.7.0' + s.dependency 'OneSignalXCFramework', '3.8.0' s.ios.deployment_target = '9.0' s.static_framework = true end diff --git a/lib/src/notification.dart b/lib/src/notification.dart index 855476e8..fb478585 100644 --- a/lib/src/notification.dart +++ b/lib/src/notification.dart @@ -85,6 +85,16 @@ class OSNotification extends JSONStringRepresentable { /// The subtitle of the notification String? subtitle; + /// (iOS Only) + /// value between 0 and 1 for sorting notifications in a notification summary + double? relevanceScore; + + /// (iOS Only) + /// The interruption level for the notification. This controls how the + /// notification will be displayed to the user if they are using focus modes + /// or notification summaries + String? interruptionLevel; + /// (Android Only) /// Summary notifications grouped /// Notification payload will have the most recent notification received. @@ -186,6 +196,10 @@ class OSNotification extends JSONStringRepresentable { this.subtitle = json['subtitle'] as String?; if (json.containsKey('attachments')) this.attachments = json['attachments'].cast(); + if (json.containsKey('relevanceScore')) + this.relevanceScore = json['relevanceScore'] as double?; + if (json.containsKey('interruptionLevel')) + this.interruptionLevel = json['interruptionLevel'] as String?; // Android Specific Parameters if (json.containsKey("smallIcon"))