@capacitor/local-notifications 8.2.0 → 8.2.1-dev-2549-20260617T123152.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Package.swift CHANGED
@@ -10,14 +10,13 @@ let package = Package(
10
10
  targets: ["LocalNotificationsPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "9.0.0-alpha.0")
14
14
  ],
15
15
  targets: [
16
16
  .target(
17
17
  name: "LocalNotificationsPlugin",
18
18
  dependencies: [
19
- .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
- .product(name: "Cordova", package: "capacitor-swift-pm")
19
+ .product(name: "Capacitor", package: "capacitor-swift-pm")
21
20
  ],
22
21
  path: "ios/Sources/LocalNotificationsPlugin"),
23
22
  .testTarget(
package/README.md CHANGED
@@ -42,7 +42,7 @@ The Local Notifications can be configured with the following options:
42
42
  | ------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
43
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
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 |
45
+ | **`sound`** | <code>string</code> | Set the default notification sound for notifications. 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 no sound. Only available for Android. | 1.0.0 |
46
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 |
47
47
 
48
48
  ### Examples
@@ -456,32 +456,31 @@ The object that describes a local notification.
456
456
 
457
457
  #### LocalNotificationSchema
458
458
 
459
- | Prop | Type | Description | Since |
460
- | ----------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
461
- | **`title`** | <code>string</code> | The title of the notification. | 1.0.0 |
462
- | **`body`** | <code>string</code> | The body of the notification, shown below the title. | 1.0.0 |
463
- | **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
464
- | **`summaryText`** | <code>string</code> | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
465
- | **`id`** | <code>number</code> | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
466
- | **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time. | 1.0.0 |
467
- | **`sound`** | <code>string</code> | 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 |
468
- | **`smallIcon`** | <code>string</code> | 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 |
469
- | **`largeIcon`** | <code>string</code> | 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 |
470
- | **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android. | 1.0.0 |
471
- | **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification. | 1.0.0 |
472
- | **`actionTypeId`** | <code>string</code> | Associate an action type with this notification. | 1.0.0 |
473
- | **`extra`** | <code>any</code> | Set extra data to store within this notification. | 1.0.0 |
474
- | **`threadIdentifier`** | <code>string</code> | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
475
- | **`summaryArgument`** | <code>string</code> | 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 |
476
- | **`relevanceScore`** | <code>number</code> | 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 |
477
- | **`interruptionLevel`** | <code><a href="#interruptionlevel">InterruptionLevel</a></code> | 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 |
478
- | **`group`** | <code>string</code> | 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 |
479
- | **`groupSummary`** | <code>boolean</code> | 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 |
480
- | **`channelId`** | <code>string</code> | 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 |
481
- | **`ongoing`** | <code>boolean</code> | 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 |
482
- | **`autoCancel`** | <code>boolean</code> | 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 |
483
- | **`inboxList`** | <code>string[]</code> | 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 |
484
- | **`silent`** | <code>boolean</code> | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
459
+ | Prop | Type | Description | Since |
460
+ | ----------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
461
+ | **`title`** | <code>string</code> | The title of the notification. | 1.0.0 |
462
+ | **`body`** | <code>string</code> | The body of the notification, shown below the title. | 1.0.0 |
463
+ | **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
464
+ | **`summaryText`** | <code>string</code> | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
465
+ | **`id`** | <code>number</code> | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
466
+ | **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time. | 1.0.0 |
467
+ | **`sound`** | <code>string</code> | Name of the audio file to play when this notification is displayed. Include the file extension with the filename. The file should be in the app bundle. Recommended format is `.wav`. Only available for iOS. For Android, 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 no sound. | 1.0.0 |
468
+ | **`smallIcon`** | <code>string</code> | 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 |
469
+ | **`largeIcon`** | <code>string</code> | 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 |
470
+ | **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android. | 1.0.0 |
471
+ | **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification. | 1.0.0 |
472
+ | **`actionTypeId`** | <code>string</code> | Associate an action type with this notification. | 1.0.0 |
473
+ | **`extra`** | <code>any</code> | Set extra data to store within this notification. | 1.0.0 |
474
+ | **`threadIdentifier`** | <code>string</code> | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
475
+ | **`relevanceScore`** | <code>number</code> | 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 |
476
+ | **`interruptionLevel`** | <code><a href="#interruptionlevel">InterruptionLevel</a></code> | 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 |
477
+ | **`group`** | <code>string</code> | 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 |
478
+ | **`groupSummary`** | <code>boolean</code> | 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 |
479
+ | **`channelId`** | <code>string</code> | 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. | 1.0.0 |
480
+ | **`ongoing`** | <code>boolean</code> | 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 |
481
+ | **`autoCancel`** | <code>boolean</code> | 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 |
482
+ | **`inboxList`** | <code>string[]</code> | 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 |
483
+ | **`silent`** | <code>boolean</code> | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
485
484
 
486
485
 
487
486
  #### Schedule
@@ -101,27 +101,23 @@ public class LocalNotificationManager {
101
101
  * Create notification channel
102
102
  */
103
103
  public void createNotificationChannel() {
104
- // Create the NotificationChannel, but only on API 26+ because
105
- // the NotificationChannel class is new and not in the support library
106
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
107
- CharSequence name = "Default";
108
- String description = "Default";
109
- int importance = android.app.NotificationManager.IMPORTANCE_DEFAULT;
110
- NotificationChannel channel = new NotificationChannel(DEFAULT_NOTIFICATION_CHANNEL_ID, name, importance);
111
- channel.setDescription(description);
112
- AudioAttributes audioAttributes = new AudioAttributes.Builder()
113
- .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
114
- .setUsage(AudioAttributes.USAGE_ALARM)
115
- .build();
116
- Uri soundUri = this.getDefaultSoundUrl(context);
117
- if (soundUri != null) {
118
- channel.setSound(soundUri, audioAttributes);
119
- }
120
- // Register the channel with the system; you can't change the importance
121
- // or other notification behaviors after this
122
- android.app.NotificationManager notificationManager = context.getSystemService(android.app.NotificationManager.class);
123
- notificationManager.createNotificationChannel(channel);
104
+ CharSequence name = "Default";
105
+ String description = "Default";
106
+ int importance = android.app.NotificationManager.IMPORTANCE_DEFAULT;
107
+ NotificationChannel channel = new NotificationChannel(DEFAULT_NOTIFICATION_CHANNEL_ID, name, importance);
108
+ channel.setDescription(description);
109
+ AudioAttributes audioAttributes = new AudioAttributes.Builder()
110
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
111
+ .setUsage(AudioAttributes.USAGE_ALARM)
112
+ .build();
113
+ Uri soundUri = this.getDefaultSoundUrl(context);
114
+ if (soundUri != null) {
115
+ channel.setSound(soundUri, audioAttributes);
124
116
  }
117
+ // Register the channel with the system; you can't change the importance
118
+ // or other notification behaviors after this
119
+ android.app.NotificationManager notificationManager = context.getSystemService(android.app.NotificationManager.class);
120
+ notificationManager.createNotificationChannel(channel);
125
121
  }
126
122
 
127
123
  @Nullable
@@ -40,104 +40,90 @@ public class NotificationChannelManager {
40
40
  private static String CHANNEL_LIGHT_COLOR = "lightColor";
41
41
 
42
42
  public void createChannel(PluginCall call) {
43
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
44
- JSObject channel = new JSObject();
45
- if (call.getString(CHANNEL_ID) != null) {
46
- channel.put(CHANNEL_ID, call.getString(CHANNEL_ID));
47
- } else {
48
- call.reject("Channel missing identifier");
49
- return;
50
- }
51
- if (call.getString(CHANNEL_NAME) != null) {
52
- channel.put(CHANNEL_NAME, call.getString(CHANNEL_NAME));
53
- } else {
54
- call.reject("Channel missing name");
55
- return;
56
- }
57
-
58
- channel.put(CHANNEL_IMPORTANCE, call.getInt(CHANNEL_IMPORTANCE, NotificationManager.IMPORTANCE_DEFAULT));
59
- channel.put(CHANNEL_DESCRIPTION, call.getString(CHANNEL_DESCRIPTION, ""));
60
- channel.put(CHANNEL_VISIBILITY, call.getInt(CHANNEL_VISIBILITY, NotificationCompat.VISIBILITY_PUBLIC));
61
- channel.put(CHANNEL_SOUND, call.getString(CHANNEL_SOUND, null));
62
- channel.put(CHANNEL_VIBRATE, call.getBoolean(CHANNEL_VIBRATE, false));
63
- channel.put(CHANNEL_USE_LIGHTS, call.getBoolean(CHANNEL_USE_LIGHTS, false));
64
- channel.put(CHANNEL_LIGHT_COLOR, call.getString(CHANNEL_LIGHT_COLOR, null));
65
- createChannel(channel);
66
- call.resolve();
43
+ JSObject channel = new JSObject();
44
+ if (call.getString(CHANNEL_ID) != null) {
45
+ channel.put(CHANNEL_ID, call.getString(CHANNEL_ID));
67
46
  } else {
68
- call.unavailable();
47
+ call.reject("Channel missing identifier");
48
+ return;
69
49
  }
50
+ if (call.getString(CHANNEL_NAME) != null) {
51
+ channel.put(CHANNEL_NAME, call.getString(CHANNEL_NAME));
52
+ } else {
53
+ call.reject("Channel missing name");
54
+ return;
55
+ }
56
+
57
+ channel.put(CHANNEL_IMPORTANCE, call.getInt(CHANNEL_IMPORTANCE, NotificationManager.IMPORTANCE_DEFAULT));
58
+ channel.put(CHANNEL_DESCRIPTION, call.getString(CHANNEL_DESCRIPTION, ""));
59
+ channel.put(CHANNEL_VISIBILITY, call.getInt(CHANNEL_VISIBILITY, NotificationCompat.VISIBILITY_PUBLIC));
60
+ channel.put(CHANNEL_SOUND, call.getString(CHANNEL_SOUND, null));
61
+ channel.put(CHANNEL_VIBRATE, call.getBoolean(CHANNEL_VIBRATE, false));
62
+ channel.put(CHANNEL_USE_LIGHTS, call.getBoolean(CHANNEL_USE_LIGHTS, false));
63
+ channel.put(CHANNEL_LIGHT_COLOR, call.getString(CHANNEL_LIGHT_COLOR, null));
64
+ createChannel(channel);
65
+ call.resolve();
70
66
  }
71
67
 
72
68
  public void createChannel(JSObject channel) {
73
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
74
- NotificationChannel notificationChannel = new NotificationChannel(
75
- channel.getString(CHANNEL_ID),
76
- channel.getString(CHANNEL_NAME),
77
- channel.getInteger(CHANNEL_IMPORTANCE)
78
- );
79
- notificationChannel.setDescription(channel.getString(CHANNEL_DESCRIPTION));
80
- notificationChannel.setLockscreenVisibility(channel.getInteger(CHANNEL_VISIBILITY));
81
- notificationChannel.enableVibration(channel.getBool(CHANNEL_VIBRATE));
82
- notificationChannel.enableLights(channel.getBool(CHANNEL_USE_LIGHTS));
83
- String lightColor = channel.getString(CHANNEL_LIGHT_COLOR);
84
- if (lightColor != null) {
85
- try {
86
- notificationChannel.setLightColor(Color.parseColor(lightColor));
87
- } catch (IllegalArgumentException ex) {
88
- Logger.error(Logger.tags("NotificationChannel"), "Invalid color provided for light color.", null);
89
- }
69
+ NotificationChannel notificationChannel = new NotificationChannel(
70
+ channel.getString(CHANNEL_ID),
71
+ channel.getString(CHANNEL_NAME),
72
+ channel.getInteger(CHANNEL_IMPORTANCE)
73
+ );
74
+ notificationChannel.setDescription(channel.getString(CHANNEL_DESCRIPTION));
75
+ notificationChannel.setLockscreenVisibility(channel.getInteger(CHANNEL_VISIBILITY));
76
+ notificationChannel.enableVibration(channel.getBool(CHANNEL_VIBRATE));
77
+ notificationChannel.enableLights(channel.getBool(CHANNEL_USE_LIGHTS));
78
+ String lightColor = channel.getString(CHANNEL_LIGHT_COLOR);
79
+ if (lightColor != null) {
80
+ try {
81
+ notificationChannel.setLightColor(Color.parseColor(lightColor));
82
+ } catch (IllegalArgumentException ex) {
83
+ Logger.error(Logger.tags("NotificationChannel"), "Invalid color provided for light color.", null);
90
84
  }
91
- String sound = channel.getString(CHANNEL_SOUND, null);
92
- if (sound != null && !sound.isEmpty()) {
93
- if (sound.contains(".")) {
94
- sound = sound.substring(0, sound.lastIndexOf('.'));
95
- }
96
- AudioAttributes audioAttributes = new AudioAttributes.Builder()
97
- .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
98
- .setUsage(AudioAttributes.USAGE_NOTIFICATION)
99
- .build();
100
- Uri soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/raw/" + sound);
101
- notificationChannel.setSound(soundUri, audioAttributes);
85
+ }
86
+ String sound = channel.getString(CHANNEL_SOUND, null);
87
+ if (sound != null && !sound.isEmpty()) {
88
+ if (sound.contains(".")) {
89
+ sound = sound.substring(0, sound.lastIndexOf('.'));
102
90
  }
103
- notificationManager.createNotificationChannel(notificationChannel);
91
+ AudioAttributes audioAttributes = new AudioAttributes.Builder()
92
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
93
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION)
94
+ .build();
95
+ Uri soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/raw/" + sound);
96
+ notificationChannel.setSound(soundUri, audioAttributes);
104
97
  }
98
+ notificationManager.createNotificationChannel(notificationChannel);
105
99
  }
106
100
 
107
101
  public void deleteChannel(PluginCall call) {
108
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
109
- String channelId = call.getString("id");
110
- notificationManager.deleteNotificationChannel(channelId);
111
- call.resolve();
112
- } else {
113
- call.unavailable();
114
- }
102
+ String channelId = call.getString("id");
103
+ notificationManager.deleteNotificationChannel(channelId);
104
+ call.resolve();
115
105
  }
116
106
 
117
107
  public void listChannels(PluginCall call) {
118
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
119
- List<NotificationChannel> notificationChannels = notificationManager.getNotificationChannels();
120
- JSArray channels = new JSArray();
121
- for (NotificationChannel notificationChannel : notificationChannels) {
122
- JSObject channel = new JSObject();
123
- channel.put(CHANNEL_ID, notificationChannel.getId());
124
- channel.put(CHANNEL_NAME, notificationChannel.getName());
125
- channel.put(CHANNEL_DESCRIPTION, notificationChannel.getDescription());
126
- channel.put(CHANNEL_IMPORTANCE, notificationChannel.getImportance());
127
- channel.put(CHANNEL_VISIBILITY, notificationChannel.getLockscreenVisibility());
128
- channel.put(CHANNEL_SOUND, notificationChannel.getSound());
129
- channel.put(CHANNEL_VIBRATE, notificationChannel.shouldVibrate());
130
- channel.put(CHANNEL_USE_LIGHTS, notificationChannel.shouldShowLights());
131
- channel.put(CHANNEL_LIGHT_COLOR, String.format("#%06X", (0xFFFFFF & notificationChannel.getLightColor())));
132
- Logger.debug(Logger.tags("NotificationChannel"), "visibility " + notificationChannel.getLockscreenVisibility());
133
- Logger.debug(Logger.tags("NotificationChannel"), "importance " + notificationChannel.getImportance());
134
- channels.put(channel);
135
- }
136
- JSObject result = new JSObject();
137
- result.put("channels", channels);
138
- call.resolve(result);
139
- } else {
140
- call.unavailable();
108
+ List<NotificationChannel> notificationChannels = notificationManager.getNotificationChannels();
109
+ JSArray channels = new JSArray();
110
+ for (NotificationChannel notificationChannel : notificationChannels) {
111
+ JSObject channel = new JSObject();
112
+ channel.put(CHANNEL_ID, notificationChannel.getId());
113
+ channel.put(CHANNEL_NAME, notificationChannel.getName());
114
+ channel.put(CHANNEL_DESCRIPTION, notificationChannel.getDescription());
115
+ channel.put(CHANNEL_IMPORTANCE, notificationChannel.getImportance());
116
+ channel.put(CHANNEL_VISIBILITY, notificationChannel.getLockscreenVisibility());
117
+ channel.put(CHANNEL_SOUND, notificationChannel.getSound());
118
+ channel.put(CHANNEL_VIBRATE, notificationChannel.shouldVibrate());
119
+ channel.put(CHANNEL_USE_LIGHTS, notificationChannel.shouldShowLights());
120
+ channel.put(CHANNEL_LIGHT_COLOR, String.format("#%06X", (0xFFFFFF & notificationChannel.getLightColor())));
121
+ Logger.debug(Logger.tags("NotificationChannel"), "visibility " + notificationChannel.getLockscreenVisibility());
122
+ Logger.debug(Logger.tags("NotificationChannel"), "importance " + notificationChannel.getImportance());
123
+ channels.put(channel);
141
124
  }
125
+ JSObject result = new JSObject();
126
+ result.put("channels", channels);
127
+ call.resolve(result);
142
128
  }
143
129
  }
package/dist/docs.json CHANGED
@@ -535,7 +535,7 @@
535
535
  "name": "since"
536
536
  }
537
537
  ],
538
- "docs": "Name of the audio file to play when this notification is displayed.\n\nInclude the file extension with the filename.\n\nOn iOS, the file should be in the app bundle.\nOn Android, the file should be in res/raw folder.\n\nRecommended format is `.wav` because is supported by both iOS and Android.\n\nOnly available for iOS and Android 7.x.\nFor Android 8+ use channelId of a channel configured with the desired sound.\n\nIf the sound file is not found, (i.e. empty string or wrong name)\nthe default system notification sound will be used.\nIf not provided, it will produce the default sound on Android and no sound on iOS.",
538
+ "docs": "Name of the audio file to play when this notification is displayed.\n\nInclude the file extension with the filename.\n\nThe file should be in the app bundle.\n\nRecommended format is `.wav`.\n\nOnly available for iOS.\nFor Android, use channelId of a channel configured with the desired sound.\n\nIf the sound file is not found, (i.e. empty string or wrong name)\nthe default system notification sound will be used.\nIf not provided, it will produce no sound.",
539
539
  "complexTypes": [],
540
540
  "type": "string | undefined"
541
541
  },
@@ -625,22 +625,6 @@
625
625
  "complexTypes": [],
626
626
  "type": "string | undefined"
627
627
  },
628
- {
629
- "name": "summaryArgument",
630
- "tags": [
631
- {
632
- "text": "1.0.0",
633
- "name": "since"
634
- },
635
- {
636
- "text": "Use `relevanceScore` instead. This property is ignored on iOS 15+.",
637
- "name": "deprecated"
638
- }
639
- ],
640
- "docs": "The string this notification adds to the category's summary format string.\n\nSets `summaryArgument` on the\n[`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n\nOnly available for iOS.",
641
- "complexTypes": [],
642
- "type": "string | undefined"
643
- },
644
628
  {
645
629
  "name": "relevanceScore",
646
630
  "tags": [
@@ -699,7 +683,7 @@
699
683
  "name": "since"
700
684
  }
701
685
  ],
702
- "docs": "Specifies the channel the notification should be delivered on.\n\nIf channel with the given name does not exist then the notification will\nnot fire. If not provided, it will use the default channel.\n\nCalls `setChannelId()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android 8+.",
686
+ "docs": "Specifies the channel the notification should be delivered on.\n\nIf channel with the given name does not exist then the notification will\nnot fire. If not provided, it will use the default channel.\n\nCalls `setChannelId()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android.",
703
687
  "complexTypes": [],
704
688
  "type": "string | undefined"
705
689
  },
@@ -2839,7 +2823,7 @@
2839
2823
  "name": "example"
2840
2824
  }
2841
2825
  ],
2842
- "docs": "Set the default notification sound for notifications.\n\nOn Android 8+ it sets the default channel sound and can't be\nchanged unless the app is uninstalled.\n\nIf the audio file is not found, it will result in the default system\nsound being played on Android 7.x and no sound on Android 8+.\n\nOnly available for Android.",
2826
+ "docs": "Set the default notification sound for notifications.\n\nIt sets the default channel sound and can't be\nchanged unless the app is uninstalled.\n\nIf the audio file is not found, it will result in no sound.\n\nOnly available for Android.",
2843
2827
  "complexTypes": [],
2844
2828
  "type": "string | undefined"
2845
2829
  },
@@ -31,11 +31,10 @@ declare module '@capacitor/cli' {
31
31
  /**
32
32
  * Set the default notification sound for notifications.
33
33
  *
34
- * On Android 8+ it sets the default channel sound and can't be
34
+ * It sets the default channel sound and can't be
35
35
  * changed unless the app is uninstalled.
36
36
  *
37
- * If the audio file is not found, it will result in the default system
38
- * sound being played on Android 7.x and no sound on Android 8+.
37
+ * If the audio file is not found, it will result in no sound.
39
38
  *
40
39
  * Only available for Android.
41
40
  *
@@ -534,17 +533,16 @@ export interface LocalNotificationSchema {
534
533
  *
535
534
  * Include the file extension with the filename.
536
535
  *
537
- * On iOS, the file should be in the app bundle.
538
- * On Android, the file should be in res/raw folder.
536
+ * The file should be in the app bundle.
539
537
  *
540
- * Recommended format is `.wav` because is supported by both iOS and Android.
538
+ * Recommended format is `.wav`.
541
539
  *
542
- * Only available for iOS and Android 7.x.
543
- * For Android 8+ use channelId of a channel configured with the desired sound.
540
+ * Only available for iOS.
541
+ * For Android, use channelId of a channel configured with the desired sound.
544
542
  *
545
543
  * If the sound file is not found, (i.e. empty string or wrong name)
546
544
  * the default system notification sound will be used.
547
- * If not provided, it will produce the default sound on Android and no sound on iOS.
545
+ * If not provided, it will produce no sound.
548
546
  *
549
547
  * @since 1.0.0
550
548
  */
@@ -613,18 +611,6 @@ export interface LocalNotificationSchema {
613
611
  * @since 1.0.0
614
612
  */
615
613
  threadIdentifier?: string;
616
- /**
617
- * The string this notification adds to the category's summary format string.
618
- *
619
- * Sets `summaryArgument` on the
620
- * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
621
- *
622
- * Only available for iOS.
623
- *
624
- * @since 1.0.0
625
- * @deprecated Use `relevanceScore` instead. This property is ignored on iOS 15+.
626
- */
627
- summaryArgument?: string;
628
614
  /**
629
615
  * The score the system uses to determine if the notification is the
630
616
  * featured notification when the system groups the app's notifications.
@@ -686,7 +672,7 @@ export interface LocalNotificationSchema {
686
672
  * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
687
673
  * with the provided value.
688
674
  *
689
- * Only available for Android 8+.
675
+ * Only available for Android.
690
676
  *
691
677
  * @since 1.0.0
692
678
  */
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAupCxC;;GAEG;AACH,MAAM,CAAN,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,yCAAU,CAAA;IACV,yCAAU,CAAA;IACV,2CAAW,CAAA;IACX,+CAAa,CAAA;IACb,6CAAY,CAAA;IACZ,yCAAU,CAAA;IACV,6CAAY,CAAA;AACd,CAAC,EARW,OAAO,KAAP,OAAO,QAQlB","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\nimport type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\nexport type LocalNotificationPresentationOption = 'badge' | 'sound' | 'banner' | 'list';\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * The Local Notifications can be configured with the following options:\n */\n LocalNotifications?: {\n /**\n * Set the default status bar icon for notifications.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"ic_stat_icon_config_sample\"\n */\n smallIcon?: string;\n\n /**\n * Set the default color of status bar icons for notifications.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"#488AFF\"\n */\n iconColor?: string;\n\n /**\n * Set the default notification sound for notifications.\n *\n * On Android 8+ it sets the default channel sound and can't be\n * changed unless the app is uninstalled.\n *\n * If the audio file is not found, it will result in the default system\n * sound being played on Android 7.x and no sound on Android 8+.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"beep.wav\"\n */\n sound?: string;\n\n /**\n * This is an array of strings you can combine. Possible values in the array are:\n * - `badge`: badge count on the app icon is updated (default value)\n * - `sound`: the device will ring/vibrate when the notification is received\n * - `banner`: the notification is displayed as a banner\n * - `list`: the notification is displayed in the notification center\n *\n * An empty array can be provided if none of the options are desired.\n *\n * Only available for iOS.\n *\n * @since 8.2.0\n * @example [\"badge\", \"sound\", \"banner\", \"list\"]\n */\n presentationOptions?: LocalNotificationPresentationOption[];\n };\n }\n}\n\nexport interface LocalNotificationsPlugin {\n /**\n * Schedule one or more local notifications.\n *\n * @since 1.0.0\n */\n schedule(options: ScheduleOptions): Promise<ScheduleResult>;\n\n /**\n * Get a list of pending notifications.\n *\n * @since 1.0.0\n */\n getPending(): Promise<PendingResult>;\n\n /**\n * Register actions to take when notifications are displayed.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n registerActionTypes(options: RegisterActionTypesOptions): Promise<void>;\n\n /**\n * Cancel pending notifications.\n *\n * @since 1.0.0\n */\n cancel(options: CancelOptions): Promise<void>;\n\n /**\n * Check if notifications are enabled or not.\n *\n * @deprecated Use `checkPermissions()` to check if the user has allowed\n * notifications to be displayed.\n * @since 1.0.0\n */\n areEnabled(): Promise<EnabledResult>;\n\n /**\n * Get a list of notifications that are visible on the notifications screen.\n *\n * @since 4.0.0\n */\n getDeliveredNotifications(): Promise<DeliveredNotifications>;\n\n /**\n * Remove the specified notifications from the notifications screen.\n *\n * @since 4.0.0\n */\n removeDeliveredNotifications(delivered: DeliveredNotifications): Promise<void>;\n\n /**\n * Remove all the notifications from the notifications screen.\n *\n * @since 4.0.0\n */\n removeAllDeliveredNotifications(): Promise<void>;\n\n /**\n * Create a notification channel.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n createChannel(channel: Channel): Promise<void>;\n\n /**\n * Delete a notification channel.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n deleteChannel(args: { id: string }): Promise<void>;\n\n /**\n * Get a list of notification channels.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n listChannels(): Promise<ListChannelsResult>;\n\n /**\n * Check permission to display local notifications.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permission to display local notifications.\n *\n * @since 1.0.0\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Direct user to the application settings screen to configure exact alarms.\n *\n * In the event that a user changes the settings from granted to denied, the application\n * will restart and any notification scheduled with an exact alarm will be deleted.\n *\n * On Android < 12, the user will NOT be directed to the application settings screen, instead this function will\n * return `granted`.\n *\n * Only available on Android.\n *\n * @since 6.0.0\n */\n changeExactNotificationSetting(): Promise<SettingsPermissionStatus>;\n\n /**\n * Check application setting for using exact alarms.\n *\n * Only available on Android.\n *\n * @since 6.0.0\n */\n checkExactNotificationSetting(): Promise<SettingsPermissionStatus>;\n\n /**\n * Listen for when notifications are displayed.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'localNotificationReceived',\n listenerFunc: (notification: LocalNotificationSchema) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for when an action is performed on a notification.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'localNotificationActionPerformed',\n listenerFunc: (notificationAction: ActionPerformed) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * The object that describes a local notification.\n *\n * @since 1.0.0\n */\nexport interface LocalNotificationDescriptor {\n /**\n * The notification identifier.\n *\n * @since 1.0.0\n */\n id: number;\n}\n\nexport interface ScheduleOptions {\n /**\n * The list of notifications to schedule.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationSchema[];\n}\n\nexport interface ScheduleResult {\n /**\n * The list of scheduled notifications.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationDescriptor[];\n}\n\nexport interface PendingResult {\n /**\n * The list of pending notifications.\n *\n * @since 1.0.0\n */\n notifications: PendingLocalNotificationSchema[];\n}\n\nexport interface RegisterActionTypesOptions {\n /**\n * The list of action types to register.\n *\n * @since 1.0.0\n */\n types: ActionType[];\n}\n\nexport interface CancelOptions {\n /**\n * The list of notifications to cancel.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationDescriptor[];\n}\n\n/**\n * A collection of actions.\n *\n * @since 1.0.0\n */\nexport interface ActionType {\n /**\n * The ID of the action type.\n *\n * Referenced in notifications by the `actionTypeId` key.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The list of actions associated with this action type.\n *\n * @since 1.0.0\n */\n actions?: Action[];\n\n /**\n * Sets `hiddenPreviewsBodyPlaceholder` of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsBodyPlaceholder?: string;\n\n /**\n * Sets `customDismissAction` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosCustomDismissAction?: boolean;\n\n /**\n * Sets `allowInCarPlay` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosAllowInCarPlay?: boolean;\n\n /**\n * Sets `hiddenPreviewsShowTitle` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsShowTitle?: boolean;\n\n /**\n * Sets `hiddenPreviewsShowSubtitle` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsShowSubtitle?: boolean;\n}\n\n/**\n * An action that can be taken when a notification is displayed.\n *\n * @since 1.0.0\n */\nexport interface Action {\n /**\n * The action identifier.\n *\n * Referenced in the `'actionPerformed'` event as `actionId`.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The title text to display for this action.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * Sets `authenticationRequired` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n requiresAuthentication?: boolean;\n\n /**\n * Sets `foreground` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n foreground?: boolean;\n\n /**\n * Sets `destructive` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n destructive?: boolean;\n\n /**\n * Use a `UNTextInputNotificationAction` instead of a `UNNotificationAction`.\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n input?: boolean;\n\n /**\n * Sets `textInputButtonTitle` on the\n * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).\n *\n * Only available for iOS when `input` is `true`.\n *\n * @since 1.0.0\n */\n inputButtonTitle?: string;\n\n /**\n * Sets `textInputPlaceholder` on the\n * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).\n *\n * Only available for iOS when `input` is `true`.\n *\n * @since 1.0.0\n */\n inputPlaceholder?: string;\n}\n\n/**\n * Represents a notification attachment.\n *\n * @since 1.0.0\n */\nexport interface Attachment {\n /**\n * The attachment identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The URL to the attachment.\n *\n * Use the `res` scheme to reference web assets, e.g.\n * `res:///assets/img/icon.png`. Also accepts `file` URLs.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * Attachment options.\n *\n * @since 1.0.0\n */\n options?: AttachmentOptions;\n}\n\nexport interface AttachmentOptions {\n /**\n * Sets the `UNNotificationAttachmentOptionsTypeHintKey` key in the hashable\n * options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsTypeHintKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailHiddenKey` key in the\n * hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailHiddenKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailClippingRectKey` key in\n * the hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailClippingRectKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailTimeKey` key in the\n * hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailTimeKey?: string;\n}\n\nexport interface PendingLocalNotificationSchema {\n /**\n * The title of the notification.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 1.0.0\n */\n body: string;\n\n /**\n * The notification identifier.\n *\n * @since 1.0.0\n */\n id: number;\n\n /**\n * Schedule this notification for a later time.\n *\n * @since 1.0.0\n */\n schedule?: Schedule;\n\n /**\n * Set extra data to store within this notification.\n *\n * @since 1.0.0\n */\n extra?: any;\n}\n\nexport interface LocalNotificationSchema {\n /**\n * The title of the notification.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 1.0.0\n */\n body: string;\n\n /**\n * Sets a multiline text block for display in a big text notification style.\n *\n * @since 1.0.0\n */\n largeBody?: string;\n\n /**\n * Used to set the summary text detail in inbox and big text notification styles.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n summaryText?: string;\n /**\n * The notification identifier.\n * On Android it's a 32-bit int.\n * So the value should be between -2147483648 and 2147483647 inclusive.\n *\n * @since 1.0.0\n */\n id: number;\n\n /**\n * Schedule this notification for a later time.\n *\n * @since 1.0.0\n */\n schedule?: Schedule;\n\n /**\n * Name of the audio file to play when this notification is displayed.\n *\n * Include the file extension with the filename.\n *\n * On iOS, the file should be in the app bundle.\n * On Android, the file should be in res/raw folder.\n *\n * Recommended format is `.wav` because is supported by both iOS and Android.\n *\n * Only available for iOS and Android 7.x.\n * For Android 8+ use channelId of a channel configured with the desired sound.\n *\n * If the sound file is not found, (i.e. empty string or wrong name)\n * the default system notification sound will be used.\n * If not provided, it will produce the default sound on Android and no sound on iOS.\n *\n * @since 1.0.0\n */\n sound?: string;\n\n /**\n * Set a custom status bar icon.\n *\n * If set, this overrides the `smallIcon` option from Capacitor\n * configuration.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n smallIcon?: string;\n\n /**\n * Set a large icon for notifications.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n largeIcon?: string;\n\n /**\n * Set the color of the notification icon.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n iconColor?: string;\n\n /**\n * Set attachments for this notification.\n *\n * @since 1.0.0\n */\n attachments?: Attachment[];\n\n /**\n * Associate an action type with this notification.\n *\n * @since 1.0.0\n */\n actionTypeId?: string;\n\n /**\n * Set extra data to store within this notification.\n *\n * @since 1.0.0\n */\n extra?: any;\n\n /**\n * Used to group multiple notifications.\n *\n * Sets `threadIdentifier` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n threadIdentifier?: string;\n\n /**\n * The string this notification adds to the category's summary format string.\n *\n * Sets `summaryArgument` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n * @deprecated Use `relevanceScore` instead. This property is ignored on iOS 15+.\n */\n summaryArgument?: string;\n\n /**\n * The score the system uses to determine if the notification is the\n * featured notification when the system groups the app's notifications.\n *\n * The value must be between 0 and 1, where 0 is the least relevant and\n * 1 is the most relevant. The default value is 0.\n *\n * Sets `relevanceScore` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 8.1.0\n */\n relevanceScore?: number;\n\n /**\n * The interruption level that indicates the priority and delivery timing of a notification.\n *\n * Sets `interruptionLevel` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 8.1.0\n */\n interruptionLevel?: InterruptionLevel;\n\n /**\n * Used to group multiple notifications.\n *\n * Calls `setGroup()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n group?: string;\n\n /**\n * If true, this notification becomes the summary for a group of\n * notifications.\n *\n * Calls `setGroupSummary()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android when using `group`.\n *\n * @since 1.0.0\n */\n groupSummary?: boolean;\n\n /**\n * Specifies the channel the notification should be delivered on.\n *\n * If channel with the given name does not exist then the notification will\n * not fire. If not provided, it will use the default channel.\n *\n * Calls `setChannelId()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android 8+.\n *\n * @since 1.0.0\n */\n channelId?: string;\n\n /**\n * If true, the notification can't be swiped away.\n *\n * Calls `setOngoing()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n ongoing?: boolean;\n\n /**\n * If true, the notification is canceled when the user clicks on it.\n *\n * Calls `setAutoCancel()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n autoCancel?: boolean;\n\n /**\n * Sets a list of strings for display in an inbox style notification.\n *\n * Up to 5 strings are allowed.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n inboxList?: string[];\n\n /**\n * If true, notification will not appear while app is in the foreground.\n *\n * Only available for iOS.\n *\n * @since 5.0.0\n */\n silent?: boolean;\n}\n\n/**\n * Represents a schedule for a notification.\n *\n * Use either `at`, `on`, or `every` to schedule notifications.\n *\n * @since 1.0.0\n */\nexport interface Schedule {\n /**\n * Schedule a notification at a specific date and time.\n *\n * @since 1.0.0\n */\n at?: Date;\n\n /**\n * Repeat delivery of this notification at the date and time specified by\n * `at`.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n repeats?: boolean;\n\n /**\n * Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)\n *\n * Note that these notifications can only fire [once per 9 minutes, per app](https://developer.android.com/training/monitoring-device-state/doze-standby#assessing_your_app).\n *\n * @since 1.0.0\n */\n allowWhileIdle?: boolean;\n\n /**\n * Schedule a notification on particular interval(s).\n *\n * This is similar to scheduling [cron](https://en.wikipedia.org/wiki/Cron)\n * jobs.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n on?: ScheduleOn;\n\n /**\n * Schedule a notification on a particular interval.\n *\n * @since 1.0.0\n */\n every?: ScheduleEvery;\n\n /**\n * Limit the number times a notification is delivered by the interval\n * specified by `every`.\n *\n * @since 1.0.0\n */\n count?: number;\n}\n\nexport interface ScheduleOn {\n year?: number;\n month?: number;\n day?: number;\n weekday?: Weekday;\n hour?: number;\n minute?: number;\n second?: number;\n}\n\nexport type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';\n\n/**\n * The interruption level that indicates the priority and delivery timing of a notification.\n *\n * - `active`: The system presents the notification immediately, lights up the screen, and can play a sound.\n * - `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.\n * Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).\n * - `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.\n * - `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.\n * Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.\n * Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.\n * See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.\n *\n * @since 8.1.0\n */\nexport type InterruptionLevel = 'active' | 'critical' | 'passive' | 'timeSensitive';\n\nexport interface ListChannelsResult {\n /**\n * The list of notification channels.\n *\n * @since 1.0.0\n */\n channels: Channel[];\n}\n\nexport interface PermissionStatus {\n /**\n * Permission state of displaying notifications.\n *\n * @since 1.0.0\n */\n display: PermissionState;\n}\n\nexport interface SettingsPermissionStatus {\n /**\n * Permission state of using exact alarms.\n *\n * @since 6.0.0\n */\n exact_alarm: PermissionState;\n}\n\nexport interface ActionPerformed {\n /**\n * The identifier of the performed action.\n *\n * @since 1.0.0\n */\n actionId: string;\n\n /**\n * The value entered by the user on the notification.\n *\n * Only available on iOS for notifications with `input` set to `true`.\n *\n * @since 1.0.0\n */\n inputValue?: string;\n\n /**\n * The original notification schema.\n *\n * @since 1.0.0\n */\n notification: LocalNotificationSchema;\n}\n\n/**\n * @deprecated\n */\nexport interface EnabledResult {\n /**\n * Whether or not the device has local notifications enabled.\n *\n * @since 1.0.0\n */\n value: boolean;\n}\n\nexport interface DeliveredNotificationSchema {\n /**\n * The notification identifier.\n *\n * @since 4.0.0\n */\n id: number;\n\n /**\n * The notification tag.\n *\n * Only available on Android.\n *\n * @since 4.0.0\n */\n tag?: string;\n /**\n * The title of the notification.\n *\n * @since 4.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 4.0.0\n */\n body: string;\n\n /**\n * The configured group of the notification.\n *\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n group?: string;\n\n /**\n * If this notification is the summary for a group of notifications.\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n groupSummary?: boolean;\n\n /**\n * Any additional data that was included in the\n * notification payload.\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n data?: any;\n\n /**\n * Extra data to store within this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n extra?: any;\n\n /**\n * The attachments for this notification.\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n attachments?: Attachment[];\n\n /**\n * Action type ssociated with this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n actionTypeId?: string;\n\n /**\n * Schedule used to fire this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n schedule?: Schedule;\n\n /**\n * Sound that was used when the notification was displayed.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n sound?: string;\n}\n\nexport interface DeliveredNotifications {\n /**\n * List of notifications that are visible on the\n * notifications screen.\n *\n * @since 1.0.0\n */\n notifications: DeliveredNotificationSchema[];\n}\n\nexport interface Channel {\n /**\n * The channel identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The human-friendly name of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The description of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n description?: string;\n\n /**\n * The sound that should be played for notifications posted to this channel.\n *\n * Notification channels with an importance of at least `3` should have a\n * sound.\n *\n * The file name of a sound file should be specified relative to the android\n * app `res/raw` directory.\n *\n * If the sound is not provided, or the sound file is not found no sound will be used.\n *\n * @since 1.0.0\n * @example \"jingle.wav\"\n */\n sound?: string;\n\n /**\n * The level of interruption for notifications posted to this channel.\n *\n * @default `3`\n * @since 1.0.0\n */\n importance?: Importance;\n\n /**\n * The visibility of notifications posted to this channel.\n *\n * This setting is for whether notifications posted to this channel appear on\n * the lockscreen or not, and if so, whether they appear in a redacted form.\n *\n * @since 1.0.0\n */\n visibility?: Visibility;\n\n /**\n * Whether notifications posted to this channel should display notification\n * lights, on devices that support it.\n *\n * @since 1.0.0\n */\n lights?: boolean;\n\n /**\n * The light color for notifications posted to this channel.\n *\n * Only supported if lights are enabled on this channel and the device\n * supports it.\n *\n * Supported color formats are `#RRGGBB` and `#RRGGBBAA`.\n *\n * @since 1.0.0\n */\n lightColor?: string;\n\n /**\n * Whether notifications posted to this channel should vibrate.\n *\n * @since 1.0.0\n */\n vibration?: boolean;\n}\n\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport enum Weekday {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\n/**\n * The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)\n * @since 1.0.0\n */\nexport type Importance = 0 | 1 | 2 | 3 | 4 | 5;\n\n/**\n * The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)\n * @since 1.0.0\n */\nexport type Visibility = -1 | 0 | 1;\n\n/**\n * @deprecated Use 'Channel`.\n * @since 1.0.0\n */\nexport type NotificationChannel = Channel;\n\n/**\n * @deprecated Use `LocalNotificationDescriptor`.\n * @since 1.0.0\n */\nexport type LocalNotificationRequest = LocalNotificationDescriptor;\n\n/**\n * @deprecated Use `ScheduleResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationScheduleResult = ScheduleResult;\n\n/**\n * @deprecated Use `PendingResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationPendingList = PendingResult;\n\n/**\n * @deprecated Use `ActionType`.\n * @since 1.0.0\n */\nexport type LocalNotificationActionType = ActionType;\n\n/**\n * @deprecated Use `Action`.\n * @since 1.0.0\n */\nexport type LocalNotificationAction = Action;\n\n/**\n * @deprecated Use `EnabledResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationEnabledResult = EnabledResult;\n\n/**\n * @deprecated Use `ListChannelsResult`.\n * @since 1.0.0\n */\nexport type NotificationChannelList = ListChannelsResult;\n\n/**\n * @deprecated Use `Attachment`.\n * @since 1.0.0\n */\nexport type LocalNotificationAttachment = Attachment;\n\n/**\n * @deprecated Use `AttachmentOptions`.\n * @since 1.0.0\n */\nexport type LocalNotificationAttachmentOptions = AttachmentOptions;\n\n/**\n * @deprecated Use `LocalNotificationSchema`.\n * @since 1.0.0\n */\nexport type LocalNotification = LocalNotificationSchema;\n\n/**\n * @deprecated Use `Schedule`.\n * @since 1.0.0\n */\nexport type LocalNotificationSchedule = Schedule;\n\n/**\n * @deprecated Use `ActionPerformed`.\n * @since 1.0.0\n */\nexport type LocalNotificationActionPerformed = ActionPerformed;\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAwoCxC;;GAEG;AACH,MAAM,CAAN,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,yCAAU,CAAA;IACV,yCAAU,CAAA;IACV,2CAAW,CAAA;IACX,+CAAa,CAAA;IACb,6CAAY,CAAA;IACZ,yCAAU,CAAA;IACV,6CAAY,CAAA;AACd,CAAC,EARW,OAAO,KAAP,OAAO,QAQlB","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\nimport type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\nexport type LocalNotificationPresentationOption = 'badge' | 'sound' | 'banner' | 'list';\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * The Local Notifications can be configured with the following options:\n */\n LocalNotifications?: {\n /**\n * Set the default status bar icon for notifications.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"ic_stat_icon_config_sample\"\n */\n smallIcon?: string;\n\n /**\n * Set the default color of status bar icons for notifications.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"#488AFF\"\n */\n iconColor?: string;\n\n /**\n * Set the default notification sound for notifications.\n *\n * It sets the default channel sound and can't be\n * changed unless the app is uninstalled.\n *\n * If the audio file is not found, it will result in no sound.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"beep.wav\"\n */\n sound?: string;\n\n /**\n * This is an array of strings you can combine. Possible values in the array are:\n * - `badge`: badge count on the app icon is updated (default value)\n * - `sound`: the device will ring/vibrate when the notification is received\n * - `banner`: the notification is displayed as a banner\n * - `list`: the notification is displayed in the notification center\n *\n * An empty array can be provided if none of the options are desired.\n *\n * Only available for iOS.\n *\n * @since 8.2.0\n * @example [\"badge\", \"sound\", \"banner\", \"list\"]\n */\n presentationOptions?: LocalNotificationPresentationOption[];\n };\n }\n}\n\nexport interface LocalNotificationsPlugin {\n /**\n * Schedule one or more local notifications.\n *\n * @since 1.0.0\n */\n schedule(options: ScheduleOptions): Promise<ScheduleResult>;\n\n /**\n * Get a list of pending notifications.\n *\n * @since 1.0.0\n */\n getPending(): Promise<PendingResult>;\n\n /**\n * Register actions to take when notifications are displayed.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n registerActionTypes(options: RegisterActionTypesOptions): Promise<void>;\n\n /**\n * Cancel pending notifications.\n *\n * @since 1.0.0\n */\n cancel(options: CancelOptions): Promise<void>;\n\n /**\n * Check if notifications are enabled or not.\n *\n * @deprecated Use `checkPermissions()` to check if the user has allowed\n * notifications to be displayed.\n * @since 1.0.0\n */\n areEnabled(): Promise<EnabledResult>;\n\n /**\n * Get a list of notifications that are visible on the notifications screen.\n *\n * @since 4.0.0\n */\n getDeliveredNotifications(): Promise<DeliveredNotifications>;\n\n /**\n * Remove the specified notifications from the notifications screen.\n *\n * @since 4.0.0\n */\n removeDeliveredNotifications(delivered: DeliveredNotifications): Promise<void>;\n\n /**\n * Remove all the notifications from the notifications screen.\n *\n * @since 4.0.0\n */\n removeAllDeliveredNotifications(): Promise<void>;\n\n /**\n * Create a notification channel.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n createChannel(channel: Channel): Promise<void>;\n\n /**\n * Delete a notification channel.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n deleteChannel(args: { id: string }): Promise<void>;\n\n /**\n * Get a list of notification channels.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n listChannels(): Promise<ListChannelsResult>;\n\n /**\n * Check permission to display local notifications.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permission to display local notifications.\n *\n * @since 1.0.0\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Direct user to the application settings screen to configure exact alarms.\n *\n * In the event that a user changes the settings from granted to denied, the application\n * will restart and any notification scheduled with an exact alarm will be deleted.\n *\n * On Android < 12, the user will NOT be directed to the application settings screen, instead this function will\n * return `granted`.\n *\n * Only available on Android.\n *\n * @since 6.0.0\n */\n changeExactNotificationSetting(): Promise<SettingsPermissionStatus>;\n\n /**\n * Check application setting for using exact alarms.\n *\n * Only available on Android.\n *\n * @since 6.0.0\n */\n checkExactNotificationSetting(): Promise<SettingsPermissionStatus>;\n\n /**\n * Listen for when notifications are displayed.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'localNotificationReceived',\n listenerFunc: (notification: LocalNotificationSchema) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for when an action is performed on a notification.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'localNotificationActionPerformed',\n listenerFunc: (notificationAction: ActionPerformed) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * The object that describes a local notification.\n *\n * @since 1.0.0\n */\nexport interface LocalNotificationDescriptor {\n /**\n * The notification identifier.\n *\n * @since 1.0.0\n */\n id: number;\n}\n\nexport interface ScheduleOptions {\n /**\n * The list of notifications to schedule.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationSchema[];\n}\n\nexport interface ScheduleResult {\n /**\n * The list of scheduled notifications.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationDescriptor[];\n}\n\nexport interface PendingResult {\n /**\n * The list of pending notifications.\n *\n * @since 1.0.0\n */\n notifications: PendingLocalNotificationSchema[];\n}\n\nexport interface RegisterActionTypesOptions {\n /**\n * The list of action types to register.\n *\n * @since 1.0.0\n */\n types: ActionType[];\n}\n\nexport interface CancelOptions {\n /**\n * The list of notifications to cancel.\n *\n * @since 1.0.0\n */\n notifications: LocalNotificationDescriptor[];\n}\n\n/**\n * A collection of actions.\n *\n * @since 1.0.0\n */\nexport interface ActionType {\n /**\n * The ID of the action type.\n *\n * Referenced in notifications by the `actionTypeId` key.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The list of actions associated with this action type.\n *\n * @since 1.0.0\n */\n actions?: Action[];\n\n /**\n * Sets `hiddenPreviewsBodyPlaceholder` of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsBodyPlaceholder?: string;\n\n /**\n * Sets `customDismissAction` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosCustomDismissAction?: boolean;\n\n /**\n * Sets `allowInCarPlay` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosAllowInCarPlay?: boolean;\n\n /**\n * Sets `hiddenPreviewsShowTitle` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsShowTitle?: boolean;\n\n /**\n * Sets `hiddenPreviewsShowSubtitle` in the options of the\n * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosHiddenPreviewsShowSubtitle?: boolean;\n}\n\n/**\n * An action that can be taken when a notification is displayed.\n *\n * @since 1.0.0\n */\nexport interface Action {\n /**\n * The action identifier.\n *\n * Referenced in the `'actionPerformed'` event as `actionId`.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The title text to display for this action.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * Sets `authenticationRequired` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n requiresAuthentication?: boolean;\n\n /**\n * Sets `foreground` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n foreground?: boolean;\n\n /**\n * Sets `destructive` in the options of the\n * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n destructive?: boolean;\n\n /**\n * Use a `UNTextInputNotificationAction` instead of a `UNNotificationAction`.\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n input?: boolean;\n\n /**\n * Sets `textInputButtonTitle` on the\n * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).\n *\n * Only available for iOS when `input` is `true`.\n *\n * @since 1.0.0\n */\n inputButtonTitle?: string;\n\n /**\n * Sets `textInputPlaceholder` on the\n * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).\n *\n * Only available for iOS when `input` is `true`.\n *\n * @since 1.0.0\n */\n inputPlaceholder?: string;\n}\n\n/**\n * Represents a notification attachment.\n *\n * @since 1.0.0\n */\nexport interface Attachment {\n /**\n * The attachment identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The URL to the attachment.\n *\n * Use the `res` scheme to reference web assets, e.g.\n * `res:///assets/img/icon.png`. Also accepts `file` URLs.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * Attachment options.\n *\n * @since 1.0.0\n */\n options?: AttachmentOptions;\n}\n\nexport interface AttachmentOptions {\n /**\n * Sets the `UNNotificationAttachmentOptionsTypeHintKey` key in the hashable\n * options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsTypeHintKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailHiddenKey` key in the\n * hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailHiddenKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailClippingRectKey` key in\n * the hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailClippingRectKey?: string;\n\n /**\n * Sets the `UNNotificationAttachmentOptionsThumbnailTimeKey` key in the\n * hashable options of\n * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n iosUNNotificationAttachmentOptionsThumbnailTimeKey?: string;\n}\n\nexport interface PendingLocalNotificationSchema {\n /**\n * The title of the notification.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 1.0.0\n */\n body: string;\n\n /**\n * The notification identifier.\n *\n * @since 1.0.0\n */\n id: number;\n\n /**\n * Schedule this notification for a later time.\n *\n * @since 1.0.0\n */\n schedule?: Schedule;\n\n /**\n * Set extra data to store within this notification.\n *\n * @since 1.0.0\n */\n extra?: any;\n}\n\nexport interface LocalNotificationSchema {\n /**\n * The title of the notification.\n *\n * @since 1.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 1.0.0\n */\n body: string;\n\n /**\n * Sets a multiline text block for display in a big text notification style.\n *\n * @since 1.0.0\n */\n largeBody?: string;\n\n /**\n * Used to set the summary text detail in inbox and big text notification styles.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n summaryText?: string;\n /**\n * The notification identifier.\n * On Android it's a 32-bit int.\n * So the value should be between -2147483648 and 2147483647 inclusive.\n *\n * @since 1.0.0\n */\n id: number;\n\n /**\n * Schedule this notification for a later time.\n *\n * @since 1.0.0\n */\n schedule?: Schedule;\n\n /**\n * Name of the audio file to play when this notification is displayed.\n *\n * Include the file extension with the filename.\n *\n * The file should be in the app bundle.\n *\n * Recommended format is `.wav`.\n *\n * Only available for iOS.\n * For Android, use channelId of a channel configured with the desired sound.\n *\n * If the sound file is not found, (i.e. empty string or wrong name)\n * the default system notification sound will be used.\n * If not provided, it will produce no sound.\n *\n * @since 1.0.0\n */\n sound?: string;\n\n /**\n * Set a custom status bar icon.\n *\n * If set, this overrides the `smallIcon` option from Capacitor\n * configuration.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n smallIcon?: string;\n\n /**\n * Set a large icon for notifications.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n largeIcon?: string;\n\n /**\n * Set the color of the notification icon.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n iconColor?: string;\n\n /**\n * Set attachments for this notification.\n *\n * @since 1.0.0\n */\n attachments?: Attachment[];\n\n /**\n * Associate an action type with this notification.\n *\n * @since 1.0.0\n */\n actionTypeId?: string;\n\n /**\n * Set extra data to store within this notification.\n *\n * @since 1.0.0\n */\n extra?: any;\n\n /**\n * Used to group multiple notifications.\n *\n * Sets `threadIdentifier` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n threadIdentifier?: string;\n\n /**\n * The score the system uses to determine if the notification is the\n * featured notification when the system groups the app's notifications.\n *\n * The value must be between 0 and 1, where 0 is the least relevant and\n * 1 is the most relevant. The default value is 0.\n *\n * Sets `relevanceScore` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 8.1.0\n */\n relevanceScore?: number;\n\n /**\n * The interruption level that indicates the priority and delivery timing of a notification.\n *\n * Sets `interruptionLevel` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 8.1.0\n */\n interruptionLevel?: InterruptionLevel;\n\n /**\n * Used to group multiple notifications.\n *\n * Calls `setGroup()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n group?: string;\n\n /**\n * If true, this notification becomes the summary for a group of\n * notifications.\n *\n * Calls `setGroupSummary()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android when using `group`.\n *\n * @since 1.0.0\n */\n groupSummary?: boolean;\n\n /**\n * Specifies the channel the notification should be delivered on.\n *\n * If channel with the given name does not exist then the notification will\n * not fire. If not provided, it will use the default channel.\n *\n * Calls `setChannelId()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n channelId?: string;\n\n /**\n * If true, the notification can't be swiped away.\n *\n * Calls `setOngoing()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n ongoing?: boolean;\n\n /**\n * If true, the notification is canceled when the user clicks on it.\n *\n * Calls `setAutoCancel()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n autoCancel?: boolean;\n\n /**\n * Sets a list of strings for display in an inbox style notification.\n *\n * Up to 5 strings are allowed.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n inboxList?: string[];\n\n /**\n * If true, notification will not appear while app is in the foreground.\n *\n * Only available for iOS.\n *\n * @since 5.0.0\n */\n silent?: boolean;\n}\n\n/**\n * Represents a schedule for a notification.\n *\n * Use either `at`, `on`, or `every` to schedule notifications.\n *\n * @since 1.0.0\n */\nexport interface Schedule {\n /**\n * Schedule a notification at a specific date and time.\n *\n * @since 1.0.0\n */\n at?: Date;\n\n /**\n * Repeat delivery of this notification at the date and time specified by\n * `at`.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n repeats?: boolean;\n\n /**\n * Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)\n *\n * Note that these notifications can only fire [once per 9 minutes, per app](https://developer.android.com/training/monitoring-device-state/doze-standby#assessing_your_app).\n *\n * @since 1.0.0\n */\n allowWhileIdle?: boolean;\n\n /**\n * Schedule a notification on particular interval(s).\n *\n * This is similar to scheduling [cron](https://en.wikipedia.org/wiki/Cron)\n * jobs.\n *\n * Only available for iOS and Android.\n *\n * @since 1.0.0\n */\n on?: ScheduleOn;\n\n /**\n * Schedule a notification on a particular interval.\n *\n * @since 1.0.0\n */\n every?: ScheduleEvery;\n\n /**\n * Limit the number times a notification is delivered by the interval\n * specified by `every`.\n *\n * @since 1.0.0\n */\n count?: number;\n}\n\nexport interface ScheduleOn {\n year?: number;\n month?: number;\n day?: number;\n weekday?: Weekday;\n hour?: number;\n minute?: number;\n second?: number;\n}\n\nexport type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';\n\n/**\n * The interruption level that indicates the priority and delivery timing of a notification.\n *\n * - `active`: The system presents the notification immediately, lights up the screen, and can play a sound.\n * - `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.\n * Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).\n * - `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.\n * - `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.\n * Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.\n * Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.\n * See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.\n *\n * @since 8.1.0\n */\nexport type InterruptionLevel = 'active' | 'critical' | 'passive' | 'timeSensitive';\n\nexport interface ListChannelsResult {\n /**\n * The list of notification channels.\n *\n * @since 1.0.0\n */\n channels: Channel[];\n}\n\nexport interface PermissionStatus {\n /**\n * Permission state of displaying notifications.\n *\n * @since 1.0.0\n */\n display: PermissionState;\n}\n\nexport interface SettingsPermissionStatus {\n /**\n * Permission state of using exact alarms.\n *\n * @since 6.0.0\n */\n exact_alarm: PermissionState;\n}\n\nexport interface ActionPerformed {\n /**\n * The identifier of the performed action.\n *\n * @since 1.0.0\n */\n actionId: string;\n\n /**\n * The value entered by the user on the notification.\n *\n * Only available on iOS for notifications with `input` set to `true`.\n *\n * @since 1.0.0\n */\n inputValue?: string;\n\n /**\n * The original notification schema.\n *\n * @since 1.0.0\n */\n notification: LocalNotificationSchema;\n}\n\n/**\n * @deprecated\n */\nexport interface EnabledResult {\n /**\n * Whether or not the device has local notifications enabled.\n *\n * @since 1.0.0\n */\n value: boolean;\n}\n\nexport interface DeliveredNotificationSchema {\n /**\n * The notification identifier.\n *\n * @since 4.0.0\n */\n id: number;\n\n /**\n * The notification tag.\n *\n * Only available on Android.\n *\n * @since 4.0.0\n */\n tag?: string;\n /**\n * The title of the notification.\n *\n * @since 4.0.0\n */\n title: string;\n\n /**\n * The body of the notification, shown below the title.\n *\n * @since 4.0.0\n */\n body: string;\n\n /**\n * The configured group of the notification.\n *\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n group?: string;\n\n /**\n * If this notification is the summary for a group of notifications.\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n groupSummary?: boolean;\n\n /**\n * Any additional data that was included in the\n * notification payload.\n *\n * Only available for Android.\n *\n * @since 4.0.0\n */\n data?: any;\n\n /**\n * Extra data to store within this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n extra?: any;\n\n /**\n * The attachments for this notification.\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n attachments?: Attachment[];\n\n /**\n * Action type ssociated with this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n actionTypeId?: string;\n\n /**\n * Schedule used to fire this notification.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n schedule?: Schedule;\n\n /**\n * Sound that was used when the notification was displayed.\n *\n * Only available for iOS.\n *\n * @since 4.0.0\n */\n sound?: string;\n}\n\nexport interface DeliveredNotifications {\n /**\n * List of notifications that are visible on the\n * notifications screen.\n *\n * @since 1.0.0\n */\n notifications: DeliveredNotificationSchema[];\n}\n\nexport interface Channel {\n /**\n * The channel identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The human-friendly name of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The description of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n description?: string;\n\n /**\n * The sound that should be played for notifications posted to this channel.\n *\n * Notification channels with an importance of at least `3` should have a\n * sound.\n *\n * The file name of a sound file should be specified relative to the android\n * app `res/raw` directory.\n *\n * If the sound is not provided, or the sound file is not found no sound will be used.\n *\n * @since 1.0.0\n * @example \"jingle.wav\"\n */\n sound?: string;\n\n /**\n * The level of interruption for notifications posted to this channel.\n *\n * @default `3`\n * @since 1.0.0\n */\n importance?: Importance;\n\n /**\n * The visibility of notifications posted to this channel.\n *\n * This setting is for whether notifications posted to this channel appear on\n * the lockscreen or not, and if so, whether they appear in a redacted form.\n *\n * @since 1.0.0\n */\n visibility?: Visibility;\n\n /**\n * Whether notifications posted to this channel should display notification\n * lights, on devices that support it.\n *\n * @since 1.0.0\n */\n lights?: boolean;\n\n /**\n * The light color for notifications posted to this channel.\n *\n * Only supported if lights are enabled on this channel and the device\n * supports it.\n *\n * Supported color formats are `#RRGGBB` and `#RRGGBBAA`.\n *\n * @since 1.0.0\n */\n lightColor?: string;\n\n /**\n * Whether notifications posted to this channel should vibrate.\n *\n * @since 1.0.0\n */\n vibration?: boolean;\n}\n\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport enum Weekday {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\n/**\n * The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)\n * @since 1.0.0\n */\nexport type Importance = 0 | 1 | 2 | 3 | 4 | 5;\n\n/**\n * The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)\n * @since 1.0.0\n */\nexport type Visibility = -1 | 0 | 1;\n\n/**\n * @deprecated Use 'Channel`.\n * @since 1.0.0\n */\nexport type NotificationChannel = Channel;\n\n/**\n * @deprecated Use `LocalNotificationDescriptor`.\n * @since 1.0.0\n */\nexport type LocalNotificationRequest = LocalNotificationDescriptor;\n\n/**\n * @deprecated Use `ScheduleResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationScheduleResult = ScheduleResult;\n\n/**\n * @deprecated Use `PendingResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationPendingList = PendingResult;\n\n/**\n * @deprecated Use `ActionType`.\n * @since 1.0.0\n */\nexport type LocalNotificationActionType = ActionType;\n\n/**\n * @deprecated Use `Action`.\n * @since 1.0.0\n */\nexport type LocalNotificationAction = Action;\n\n/**\n * @deprecated Use `EnabledResult`.\n * @since 1.0.0\n */\nexport type LocalNotificationEnabledResult = EnabledResult;\n\n/**\n * @deprecated Use `ListChannelsResult`.\n * @since 1.0.0\n */\nexport type NotificationChannelList = ListChannelsResult;\n\n/**\n * @deprecated Use `Attachment`.\n * @since 1.0.0\n */\nexport type LocalNotificationAttachment = Attachment;\n\n/**\n * @deprecated Use `AttachmentOptions`.\n * @since 1.0.0\n */\nexport type LocalNotificationAttachmentOptions = AttachmentOptions;\n\n/**\n * @deprecated Use `LocalNotificationSchema`.\n * @since 1.0.0\n */\nexport type LocalNotification = LocalNotificationSchema;\n\n/**\n * @deprecated Use `Schedule`.\n * @since 1.0.0\n */\nexport type LocalNotificationSchedule = Schedule;\n\n/**\n * @deprecated Use `ActionPerformed`.\n * @since 1.0.0\n */\nexport type LocalNotificationActionPerformed = ActionPerformed;\n"]}
@@ -255,12 +255,6 @@ public class LocalNotificationsPlugin: CAPPlugin, CAPBridgedPlugin {
255
255
  content.threadIdentifier = threadIdentifier
256
256
  }
257
257
 
258
- if let summaryArgument = notification["summaryArgument"] as? String {
259
- if #unavailable(iOS 15.0) {
260
- content.summaryArgument = summaryArgument
261
- }
262
- }
263
-
264
258
  if let relevanceScore = notification["relevanceScore"] as? Double {
265
259
  content.relevanceScore = relevanceScore
266
260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/local-notifications",
3
- "version": "8.2.0",
3
+ "version": "8.2.1-dev-2549-20260617T123152.0",
4
4
  "description": "The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -47,11 +47,11 @@
47
47
  "publish:cocoapod": "pod trunk push ./CapacitorLocalNotifications.podspec --allow-warnings"
48
48
  },
49
49
  "devDependencies": {
50
- "@capacitor/android": "^8.0.0",
51
- "@capacitor/cli": "^8.0.0",
52
- "@capacitor/core": "^8.0.0",
50
+ "@capacitor/android": "next",
51
+ "@capacitor/cli": "next",
52
+ "@capacitor/core": "next",
53
53
  "@capacitor/docgen": "0.3.0",
54
- "@capacitor/ios": "^8.0.0",
54
+ "@capacitor/ios": "next",
55
55
  "@ionic/eslint-config": "^0.4.0",
56
56
  "@ionic/prettier-config": "^4.0.0",
57
57
  "@ionic/swiftlint-config": "^2.0.0",
@@ -64,7 +64,7 @@
64
64
  "typescript": "^5.9.3"
65
65
  },
66
66
  "peerDependencies": {
67
- "@capacitor/core": ">=8.0.0"
67
+ "@capacitor/core": ">=9.0.0-alpha.0"
68
68
  },
69
69
  "prettier": "@ionic/prettier-config",
70
70
  "swiftlint": "@ionic/swiftlint-config",
@@ -81,6 +81,5 @@
81
81
  },
82
82
  "publishConfig": {
83
83
  "access": "public"
84
- },
85
- "gitHead": "84131ae8b1a3022f5db26feb1700a3004bd05b64"
84
+ }
86
85
  }