Skip to content

Commit 701efe4

Browse files
Merge branch 'main' into next
2 parents bfaaeea + f266d2e commit 701efe4

11 files changed

Lines changed: 117 additions & 22 deletions

File tree

local-notifications/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [8.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.2...@capacitor/local-notifications@8.1.0) (2026-05-07)
7+
8+
### Bug Fixes
9+
10+
- add Importance 0 for notification channels ([#2507](https://github.com/ionic-team/capacitor-plugins/issues/2507)) ([b98c4f9](https://github.com/ionic-team/capacitor-plugins/commit/b98c4f9ee368b66dc92fb54865129df777bf38e5))
11+
12+
### Features
13+
14+
- **local-notifications:** deprecate summaryArgument and add relevanceScore and interruptionLevel ([#2521](https://github.com/ionic-team/capacitor-plugins/issues/2521)) ([fcff6f1](https://github.com/ionic-team/capacitor-plugins/commit/fcff6f11dc8dcbe42c0738e89b4c15239629ab24))
15+
616
## [8.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.1...@capacitor/local-notifications@8.0.2) (2026-03-06)
717

818
### Bug Fixes

local-notifications/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ For more information about the behavior changes of your app related to the priva
3636
<docgen-config>
3737
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
3838

39-
On Android, the Local Notifications can be configured with the following options:
39+
The Local Notifications can be configured with the following options:
4040

41-
| Prop | Type | Description | Since |
42-
| --------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
43-
| **`smallIcon`** | <code>string</code> | Set the default status bar 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 |
44-
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 |
45-
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 8+ it sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in the default system sound being played on Android 7.x and no sound on Android 8+. Only available for Android. | 1.0.0 |
41+
| Prop | Type | Description | Since |
42+
| ------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
43+
| **`smallIcon`** | <code>string</code> | Set the default status bar 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 |
44+
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 |
45+
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 8+ it sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in the default system sound being played on Android 7.x and no sound on Android 8+. Only available for Android. | 1.0.0 |
46+
| **`presentationOptions`** | <code>LocalNotificationPresentationOption[]</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the notification is received - `banner`: the notification is displayed as a banner - `list`: the notification is displayed in the notification center An empty array can be provided if none of the options are desired. Only available for iOS. | 8.2.0 |
4647

4748
### Examples
4849

@@ -54,7 +55,8 @@ In `capacitor.config.json`:
5455
"LocalNotifications": {
5556
"smallIcon": "ic_stat_icon_config_sample",
5657
"iconColor": "#488AFF",
57-
"sound": "beep.wav"
58+
"sound": "beep.wav",
59+
"presentationOptions": ["badge", "sound", "banner", "list"]
5860
}
5961
}
6062
}
@@ -73,6 +75,7 @@ const config: CapacitorConfig = {
7375
smallIcon: "ic_stat_icon_config_sample",
7476
iconColor: "#488AFF",
7577
sound: "beep.wav",
78+
presentationOptions: ["badge", "sound", "banner", "list"],
7679
},
7780
},
7881
};

local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsHandler.swift

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,32 @@ public class LocalNotificationsHandler: NSObject, NotificationHandlerProtocol {
3535
}
3636
}
3737

38+
if let optionsArray = self.plugin?.getConfig().getArray("presentationOptions") as? [String] {
39+
var presentationOptions = UNNotificationPresentationOptions.init()
40+
41+
optionsArray.forEach { option in
42+
switch option {
43+
case "banner":
44+
presentationOptions.insert(.banner)
45+
case "list":
46+
presentationOptions.insert(.list)
47+
case "badge":
48+
presentationOptions.insert(.badge)
49+
case "sound":
50+
presentationOptions.insert(.sound)
51+
default:
52+
print("Unrecognized presentation option: \(option)")
53+
}
54+
}
55+
56+
return presentationOptions
57+
}
58+
3859
return [
3960
.badge,
4061
.sound,
41-
.alert
62+
.banner,
63+
.list
4264
]
4365
}
4466

local-notifications/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capacitor/local-notifications",
3-
"version": "8.0.2",
3+
"version": "8.1.0",
44
"description": "The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).",
55
"main": "dist/plugin.cjs.js",
66
"module": "dist/esm/index.js",

local-notifications/src/definitions.ts

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import type { PermissionState, PluginListenerHandle } from '@capacitor/core';
44

5+
export type LocalNotificationPresentationOption = 'badge' | 'sound' | 'banner' | 'list';
6+
57
declare module '@capacitor/cli' {
68
export interface PluginsConfig {
79
/**
8-
* On Android, the Local Notifications can be configured with the following options:
10+
* The Local Notifications can be configured with the following options:
911
*/
1012
LocalNotifications?: {
1113
/**
@@ -47,6 +49,22 @@ declare module '@capacitor/cli' {
4749
* @example "beep.wav"
4850
*/
4951
sound?: string;
52+
53+
/**
54+
* This is an array of strings you can combine. Possible values in the array are:
55+
* - `badge`: badge count on the app icon is updated (default value)
56+
* - `sound`: the device will ring/vibrate when the notification is received
57+
* - `banner`: the notification is displayed as a banner
58+
* - `list`: the notification is displayed in the notification center
59+
*
60+
* An empty array can be provided if none of the options are desired.
61+
*
62+
* Only available for iOS.
63+
*
64+
* @since 8.2.0
65+
* @example ["badge", "sound", "banner", "list"]
66+
*/
67+
presentationOptions?: LocalNotificationPresentationOption[];
5068
};
5169
}
5270
}
@@ -699,6 +717,34 @@ export interface LocalNotificationSchema {
699717
*/
700718
interruptionLevel?: InterruptionLevel;
701719

720+
/**
721+
* The score the system uses to determine if the notification is the
722+
* featured notification when the system groups the app's notifications.
723+
*
724+
* The value must be between 0 and 1, where 0 is the least relevant and
725+
* 1 is the most relevant. The default value is 0.
726+
*
727+
* Sets `relevanceScore` on the
728+
* [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
729+
*
730+
* Only available for iOS.
731+
*
732+
* @since 8.1.0
733+
*/
734+
relevanceScore?: number;
735+
736+
/**
737+
* The interruption level that indicates the priority and delivery timing of a notification.
738+
*
739+
* Sets `interruptionLevel` on the
740+
* [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
741+
*
742+
* Only available for iOS.
743+
*
744+
* @since 8.1.0
745+
*/
746+
interruptionLevel?: InterruptionLevel;
747+
702748
/**
703749
* Used to group multiple notifications.
704750
*

push-notifications/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [8.0.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@8.0.3...@capacitor/push-notifications@8.0.4) (2026-05-07)
7+
8+
### Bug Fixes
9+
10+
- add Importance 0 for notification channels ([#2507](https://github.com/ionic-team/capacitor-plugins/issues/2507)) ([b98c4f9](https://github.com/ionic-team/capacitor-plugins/commit/b98c4f9ee368b66dc92fb54865129df777bf38e5))
11+
612
## [8.0.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@8.0.2...@capacitor/push-notifications@8.0.3) (2026-03-25)
713

814
**Note:** Version bump only for package @capacitor/push-notifications

push-notifications/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ From Android 8.0 (API level 26) and higher, notification channels are supported
8787

8888
You can configure the way the push notifications are displayed when the app is in foreground.
8989

90-
| Prop | Type | Description | Since |
91-
| ------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
92-
| **`presentationOptions`** | <code>PresentationOption[]</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the push notification is received - `alert`: the push notification is displayed in a native dialog An empty array can be provided if none of the options are desired. badge is only available for iOS. | 1.0.0 |
90+
| Prop | Type | Description | Since |
91+
| ------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
92+
| **`presentationOptions`** | <code>PresentationOption[]</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the push notification is received - `alert`: **Deprecated on iOS.** Use `banner` and `list` instead. On Android, this value is still used to display the notification. - `banner`: the push notification is displayed as a banner - `list`: the push notification is displayed in the notification center An empty array can be provided if none of the options are desired. badge is only available for iOS. | 1.0.0 |
9393

9494
### Examples
9595

@@ -99,7 +99,7 @@ In `capacitor.config.json`:
9999
{
100100
"plugins": {
101101
"PushNotifications": {
102-
"presentationOptions": ["badge", "sound", "alert"]
102+
"presentationOptions": ["badge", "sound", "alert", "banner", "list"]
103103
}
104104
}
105105
}
@@ -115,7 +115,7 @@ import { CapacitorConfig } from '@capacitor/cli';
115115
const config: CapacitorConfig = {
116116
plugins: {
117117
PushNotifications: {
118-
presentationOptions: ["badge", "sound", "alert"],
118+
presentationOptions: ["badge", "sound", "alert", "banner", "list"],
119119
},
120120
},
121121
};

push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.firebase.messaging.NotificationParams;
2121
import com.google.firebase.messaging.RemoteMessage;
2222
import java.util.Arrays;
23+
import java.util.List;
2324
import org.json.JSONException;
2425
import org.json.JSONObject;
2526

@@ -247,7 +248,8 @@ public void fireNotification(RemoteMessage remoteMessage) {
247248
String body = notification.getBody();
248249
String[] presentation = getConfig().getArray("presentationOptions");
249250
if (presentation != null) {
250-
if (Arrays.asList(presentation).contains("alert")) {
251+
List<String> presentationList = Arrays.asList(presentation);
252+
if (presentationList.contains("alert") || presentationList.contains("banner") || presentationList.contains("list")) {
251253
Bundle bundle = null;
252254
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
253255
try {

push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol {
3434

3535
optionsArray.forEach { option in
3636
switch option {
37+
case "banner":
38+
presentationOptions.insert(.banner)
39+
case "list":
40+
presentationOptions.insert(.list)
3741
case "alert":
38-
presentationOptions.insert(.alert)
42+
presentationOptions.insert(.banner)
43+
presentationOptions.insert(.list)
3944
case "badge":
4045
presentationOptions.insert(.badge)
41-
4246
case "sound":
4347
presentationOptions.insert(.sound)
4448
default:

push-notifications/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capacitor/push-notifications",
3-
"version": "8.0.3",
3+
"version": "8.0.4",
44
"description": "The Push Notifications API provides access to native push notifications.",
55
"main": "dist/plugin.cjs.js",
66
"module": "dist/esm/index.js",

0 commit comments

Comments
 (0)