Skip to content

Commit

Permalink
retrieving timeSensitive setting for iOS 15.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-tomasetti committed Jan 30, 2025
1 parent b73c76d commit 5c26773
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/NotifeeCore/NotifeeCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,13 @@ + (void)getNotificationSettings:(notifeeMethodNSDictionaryBlock)block {
iosDictionary[@"inAppNotificationSettings"] = @-1;
}

if (@available(iOS 15.0, *)) {
iosDictionary[@"timeSensitive"] =
[NotifeeCoreUtil numberForUNNotificationSetting:settings.timeSensitiveSetting];
} else {
iosDictionary[@"timeSensitive"] = @-1;
}

iosDictionary[@"showPreviews"] = showPreviews;
iosDictionary[@"authorizationStatus"] = authorizationStatus;
iosDictionary[@"alert"] =
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/src/types/NotificationIOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ export interface IOSNotificationSettings {
*/
criticalAlert: IOSNotificationSetting;

/**
* Enum describing if time-sensitive notifications are entitled.
*/
timeSensitive: IOSNotificationSetting;

/**
* Enum describing if notification previews will be shown.
*/
Expand Down

0 comments on commit 5c26773

Please sign in to comment.