string | The title of the notification. | 1.0.0 |
-| **`body`** | string | The body of the notification, shown below the title. | 1.0.0 |
-| **`largeBody`** | string | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
-| **`summaryText`** | string | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
-| **`id`** | number | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
-| **`schedule`** | Schedule | Schedule this notification for a later time. | 1.0.0 |
-| **`sound`** | string | Name of the audio file to play when this notification is displayed. Include the file extension with the filename. On iOS, the file should be in the app bundle. On Android, the file should be in res/raw folder. Recommended format is `.wav` because is supported by both iOS and Android. Only available for iOS and Android 7.x. For Android 8+ use channelId of a channel configured with the desired sound. If the sound file is not found, (i.e. empty string or wrong name) the default system notification sound will be used. If not provided, it will produce the default sound on Android and no sound on iOS. | 1.0.0 |
-| **`smallIcon`** | string | Set a custom status bar icon. If set, this overrides the `smallIcon` option from Capacitor configuration. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
-| **`largeIcon`** | string | Set a large icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
-| **`iconColor`** | string | Set the color of the notification icon. Only available for Android. | 1.0.0 |
-| **`attachments`** | Attachment[] | Set attachments for this notification. | 1.0.0 |
-| **`actionTypeId`** | string | Associate an action type with this notification. | 1.0.0 |
-| **`extra`** | any | Set extra data to store within this notification. | 1.0.0 |
-| **`threadIdentifier`** | string | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
-| **`summaryArgument`** | string | The string this notification adds to the category's summary format string. Sets `summaryArgument` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
-| **`group`** | string | Used to group multiple notifications. Calls `setGroup()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
-| **`groupSummary`** | boolean | If true, this notification becomes the summary for a group of notifications. Calls `setGroupSummary()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android when using `group`. | 1.0.0 |
-| **`channelId`** | string | Specifies the channel the notification should be delivered on. If channel with the given name does not exist then the notification will not fire. If not provided, it will use the default channel. Calls `setChannelId()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android 8+. | 1.0.0 |
-| **`ongoing`** | boolean | If true, the notification can't be swiped away. Calls `setOngoing()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
-| **`autoCancel`** | boolean | If true, the notification is canceled when the user clicks on it. Calls `setAutoCancel()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
-| **`inboxList`** | string[] | Sets a list of strings for display in an inbox style notification. Up to 5 strings are allowed. Only available for Android. | 1.0.0 |
-| **`silent`** | boolean | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
+| Prop | Type | Description | Since |
+| ----------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
+| **`title`** | string | The title of the notification. | 1.0.0 |
+| **`body`** | string | The body of the notification, shown below the title. | 1.0.0 |
+| **`largeBody`** | string | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
+| **`summaryText`** | string | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
+| **`id`** | number | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
+| **`schedule`** | Schedule | Schedule this notification for a later time. | 1.0.0 |
+| **`sound`** | string | Name of the audio file to play when this notification is displayed. Include the file extension with the filename. On iOS, the file should be in the app bundle. On Android, the file should be in res/raw folder. Recommended format is `.wav` because is supported by both iOS and Android. Only available for iOS and Android 7.x. For Android 8+ use channelId of a channel configured with the desired sound. If the sound file is not found, (i.e. empty string or wrong name) the default system notification sound will be used. If not provided, it will produce the default sound on Android and no sound on iOS. | 1.0.0 |
+| **`smallIcon`** | string | Set a custom status bar icon. If set, this overrides the `smallIcon` option from Capacitor configuration. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
+| **`largeIcon`** | string | Set a large icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
+| **`iconColor`** | string | Set the color of the notification icon. Only available for Android. | 1.0.0 |
+| **`attachments`** | Attachment[] | Set attachments for this notification. | 1.0.0 |
+| **`actionTypeId`** | string | Associate an action type with this notification. | 1.0.0 |
+| **`extra`** | any | Set extra data to store within this notification. | 1.0.0 |
+| **`threadIdentifier`** | string | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
+| **`summaryArgument`** | string | The string this notification adds to the category's summary format string. Sets `summaryArgument` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
+| **`relevanceScore`** | number | The score the system uses to determine if the notification is the featured notification when the system groups the app's notifications. The value must be between 0 and 1, where 0 is the least relevant and 1 is the most relevant. The default value is 0. Sets `relevanceScore` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 8.1.0 |
+| **`interruptionLevel`** | InterruptionLevel | The interruption level that indicates the priority and delivery timing of a notification. Sets `interruptionLevel` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 8.1.0 |
+| **`group`** | string | Used to group multiple notifications. Calls `setGroup()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
+| **`groupSummary`** | boolean | If true, this notification becomes the summary for a group of notifications. Calls `setGroupSummary()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android when using `group`. | 1.0.0 |
+| **`channelId`** | string | Specifies the channel the notification should be delivered on. If channel with the given name does not exist then the notification will not fire. If not provided, it will use the default channel. Calls `setChannelId()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android 8+. | 1.0.0 |
+| **`ongoing`** | boolean | If true, the notification can't be swiped away. Calls `setOngoing()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
+| **`autoCancel`** | boolean | If true, the notification is canceled when the user clicks on it. Calls `setAutoCancel()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
+| **`inboxList`** | string[] | Sets a list of strings for display in an inbox style notification. Up to 5 strings are allowed. Only available for Android. | 1.0.0 |
+| **`silent`** | boolean | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
#### Schedule
@@ -735,6 +737,22 @@ An action that can be taken when a notification is displayed.
'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second'
+#### InterruptionLevel
+
+The interruption level that indicates the priority and delivery timing of a notification.
+
+- `active`: The system presents the notification immediately, lights up the screen, and can play a sound.
+- `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.
+ Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).
+- `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.
+- `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.
+ Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.
+ Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.
+ See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.
+
+'active' | 'critical' | 'passive' | 'timeSensitive'
+
+
#### Importance
The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)
diff --git a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift b/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift
index 463be9a12..8cf6ccaec 100644
--- a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift
+++ b/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift
@@ -256,7 +256,28 @@ public class LocalNotificationsPlugin: CAPPlugin, CAPBridgedPlugin {
}
if let summaryArgument = notification["summaryArgument"] as? String {
- content.summaryArgument = summaryArgument
+ if #unavailable(iOS 15.0) {
+ content.summaryArgument = summaryArgument
+ }
+ }
+
+ if let relevanceScore = notification["relevanceScore"] as? Double {
+ content.relevanceScore = relevanceScore
+ }
+
+ if let interruptionLevelString = notification["interruptionLevel"] as? String {
+ switch interruptionLevelString {
+ case "active":
+ content.interruptionLevel = .active
+ case "critical":
+ content.interruptionLevel = .critical
+ case "passive":
+ content.interruptionLevel = .passive
+ case "timeSensitive":
+ content.interruptionLevel = .timeSensitive
+ default:
+ break
+ }
}
if let sound = notification["sound"] as? String {
diff --git a/local-notifications/src/definitions.ts b/local-notifications/src/definitions.ts
index a2ef40d58..7e94d5bbb 100644
--- a/local-notifications/src/definitions.ts
+++ b/local-notifications/src/definitions.ts
@@ -680,9 +680,38 @@ export interface LocalNotificationSchema {
* Only available for iOS.
*
* @since 1.0.0
+ * @deprecated Use `relevanceScore` instead. This property is ignored on iOS 15+.
*/
summaryArgument?: string;
+ /**
+ * The score the system uses to determine if the notification is the
+ * featured notification when the system groups the app's notifications.
+ *
+ * The value must be between 0 and 1, where 0 is the least relevant and
+ * 1 is the most relevant. The default value is 0.
+ *
+ * Sets `relevanceScore` on the
+ * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
+ *
+ * Only available for iOS.
+ *
+ * @since 8.1.0
+ */
+ relevanceScore?: number;
+
+ /**
+ * The interruption level that indicates the priority and delivery timing of a notification.
+ *
+ * Sets `interruptionLevel` on the
+ * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
+ *
+ * Only available for iOS.
+ *
+ * @since 8.1.0
+ */
+ interruptionLevel?: InterruptionLevel;
+
/**
* Used to group multiple notifications.
*
@@ -847,6 +876,22 @@ export interface ScheduleOn {
export type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';
+/**
+ * The interruption level that indicates the priority and delivery timing of a notification.
+ *
+ * - `active`: The system presents the notification immediately, lights up the screen, and can play a sound.
+ * - `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.
+ * Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).
+ * - `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.
+ * - `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.
+ * Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.
+ * Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.
+ * See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.
+ *
+ * @since 8.1.0
+ */
+export type InterruptionLevel = 'active' | 'critical' | 'passive' | 'timeSensitive';
+
export interface ListChannelsResult {
/**
* The list of notification channels.