Skip to content

Commit 1f92411

Browse files
committed
adding relevanceScore and interruptionLevel to Notification.dart
1 parent 96e6998 commit 1f92411

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

ios/onesignal_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.source_files = 'Classes/**/*'
1414
s.public_header_files = 'Classes/**/*.h'
1515
s.dependency 'Flutter'
16-
s.dependency 'OneSignalXCFramework', '3.7.0'
16+
s.dependency 'OneSignalXCFramework', '3.8.0'
1717
s.ios.deployment_target = '9.0'
1818
s.static_framework = true
1919
end

lib/src/notification.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ class OSNotification extends JSONStringRepresentable {
8585
/// The subtitle of the notification
8686
String? subtitle;
8787

88+
/// (iOS Only)
89+
/// value between 0 and 1 for sorting notifications in a notification summary
90+
double? relevanceScore;
91+
92+
/// (iOS Only)
93+
/// The interruption level for the notification. This controls how the
94+
/// notification will be displayed to the user if they are using focus modes
95+
/// or notification summaries
96+
String? interruptionLevel;
97+
8898
/// (Android Only)
8999
/// Summary notifications grouped
90100
/// Notification payload will have the most recent notification received.
@@ -186,6 +196,10 @@ class OSNotification extends JSONStringRepresentable {
186196
this.subtitle = json['subtitle'] as String?;
187197
if (json.containsKey('attachments'))
188198
this.attachments = json['attachments'].cast<String, dynamic>();
199+
if (json.containsKey('relevanceScore'))
200+
this.relevanceScore = json['relevanceScore'] as double?;
201+
if (json.containsKey('interruptionLevel'))
202+
this.interruptionLevel = json['interruptionLevel'] as String?;
189203

190204
// Android Specific Parameters
191205
if (json.containsKey("smallIcon"))

0 commit comments

Comments
 (0)