@capacitor/local-notifications 1.0.5 → 1.0.10
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/CHANGELOG.md +49 -0
- package/README.md +41 -41
- package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotification.java +1 -1
- package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationSchedule.java +7 -0
- package/dist/docs.json +5 -5
- package/dist/esm/definitions.d.ts +11 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.10](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.9...@capacitor/local-notifications@1.0.10) (2022-01-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @capacitor/local-notifications
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.0.9](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.8...@capacitor/local-notifications@1.0.9) (2021-11-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @capacitor/local-notifications
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.0.8](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.7...@capacitor/local-notifications@1.0.8) (2021-10-14)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [1.0.7](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.6...@capacitor/local-notifications@1.0.7) (2021-10-13)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [1.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.5...@capacitor/local-notifications@1.0.6) (2021-09-15)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **local-notifications:** return schedule on as object ([#603](https://github.com/ionic-team/capacitor-plugins/issues/603)) ([ca34b01](https://github.com/ionic-team/capacitor-plugins/commit/ca34b01c73f14bb0ad14e8a501210e42a0e65b04))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
6
55
|
## [1.0.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.4...@capacitor/local-notifications@1.0.5) (2021-09-01)
|
|
7
56
|
|
|
8
57
|
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@ npx cap sync
|
|
|
16
16
|
|
|
17
17
|
On Android, the Local Notifications can be configured with the following options:
|
|
18
18
|
|
|
19
|
-
| Prop | Type | Description
|
|
20
|
-
| --------------- | ------------------- |
|
|
21
|
-
| **`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.
|
|
22
|
-
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android.
|
|
23
|
-
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 26+ it sets the default channel sound and can't be changed unless the app is uninstalled. Only available for Android.
|
|
19
|
+
| Prop | Type | Description | Since |
|
|
20
|
+
| --------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
21
|
+
| **`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 |
|
|
22
|
+
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 |
|
|
23
|
+
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 26+ 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 21-25 and no sound on Android 26+. Only available for Android. | 1.0.0 |
|
|
24
24
|
|
|
25
25
|
### Examples
|
|
26
26
|
|
|
@@ -78,8 +78,8 @@ If the device has entered [Doze](https://developer.android.com/training/monitori
|
|
|
78
78
|
* [`listChannels()`](#listchannels)
|
|
79
79
|
* [`checkPermissions()`](#checkpermissions)
|
|
80
80
|
* [`requestPermissions()`](#requestpermissions)
|
|
81
|
-
* [`addListener('localNotificationReceived', ...)`](#addlistenerlocalnotificationreceived
|
|
82
|
-
* [`addListener('localNotificationActionPerformed', ...)`](#addlistenerlocalnotificationactionperformed
|
|
81
|
+
* [`addListener('localNotificationReceived', ...)`](#addlistenerlocalnotificationreceived)
|
|
82
|
+
* [`addListener('localNotificationActionPerformed', ...)`](#addlistenerlocalnotificationactionperformed)
|
|
83
83
|
* [`removeAllListeners()`](#removealllisteners)
|
|
84
84
|
* [Interfaces](#interfaces)
|
|
85
85
|
* [Type Aliases](#type-aliases)
|
|
@@ -340,29 +340,29 @@ The object that describes a local notification.
|
|
|
340
340
|
|
|
341
341
|
#### LocalNotificationSchema
|
|
342
342
|
|
|
343
|
-
| Prop | Type | Description
|
|
344
|
-
| ---------------------- | --------------------------------------------- |
|
|
345
|
-
| **`title`** | <code>string</code> | The title of the notification.
|
|
346
|
-
| **`body`** | <code>string</code> | The body of the notification, shown below the title.
|
|
347
|
-
| **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style.
|
|
348
|
-
| **`summaryText`** | <code>string</code> | Used to set the summary text detail in inbox and big text notification styles. Only available for Android.
|
|
349
|
-
| **`id`** | <code>number</code> | The notification identifier.
|
|
350
|
-
| **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time.
|
|
351
|
-
| **`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 26
|
|
352
|
-
| **`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.
|
|
353
|
-
| **`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.
|
|
354
|
-
| **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android.
|
|
355
|
-
| **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification.
|
|
356
|
-
| **`actionTypeId`** | <code>string</code> | Associate an action type with this notification.
|
|
357
|
-
| **`extra`** | <code>any</code> | Set extra data to store within this notification.
|
|
358
|
-
| **`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.
|
|
359
|
-
| **`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 12+.
|
|
360
|
-
| **`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.
|
|
361
|
-
| **`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`.
|
|
362
|
-
| **`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 26+.
|
|
363
|
-
| **`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.
|
|
364
|
-
| **`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.
|
|
365
|
-
| **`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.
|
|
343
|
+
| Prop | Type | Description | Since |
|
|
344
|
+
| ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
345
|
+
| **`title`** | <code>string</code> | The title of the notification. | 1.0.0 |
|
|
346
|
+
| **`body`** | <code>string</code> | The body of the notification, shown below the title. | 1.0.0 |
|
|
347
|
+
| **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
|
|
348
|
+
| **`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 |
|
|
349
|
+
| **`id`** | <code>number</code> | The notification identifier. | 1.0.0 |
|
|
350
|
+
| **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time. | 1.0.0 |
|
|
351
|
+
| **`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 < 26. For Android 26+ 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 |
|
|
352
|
+
| **`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 |
|
|
353
|
+
| **`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 |
|
|
354
|
+
| **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android. | 1.0.0 |
|
|
355
|
+
| **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification. | 1.0.0 |
|
|
356
|
+
| **`actionTypeId`** | <code>string</code> | Associate an action type with this notification. | 1.0.0 |
|
|
357
|
+
| **`extra`** | <code>any</code> | Set extra data to store within this notification. | 1.0.0 |
|
|
358
|
+
| **`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 |
|
|
359
|
+
| **`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 12+. | 1.0.0 |
|
|
360
|
+
| **`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 |
|
|
361
|
+
| **`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 |
|
|
362
|
+
| **`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 26+. | 1.0.0 |
|
|
363
|
+
| **`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 |
|
|
364
|
+
| **`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 |
|
|
365
|
+
| **`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 |
|
|
366
366
|
|
|
367
367
|
|
|
368
368
|
#### Schedule
|
|
@@ -537,17 +537,17 @@ An action that can be taken when a notification is displayed.
|
|
|
537
537
|
|
|
538
538
|
#### Channel
|
|
539
539
|
|
|
540
|
-
| Prop | Type | Description
|
|
541
|
-
| ----------------- | ------------------------------------------------- |
|
|
542
|
-
| **`id`** | <code>string</code> | The channel identifier.
|
|
543
|
-
| **`name`** | <code>string</code> | The human-friendly name of this channel (presented to the user).
|
|
544
|
-
| **`description`** | <code>string</code> | The description of this channel (presented to the user).
|
|
545
|
-
| **`sound`** | <code>string</code> | The sound that should be played for notifications posted to this channel. Notification channels with an importance of at least `3` should have a sound. The file name of a sound file should be specified relative to the android app `res/raw` directory. | 1.0.0 |
|
|
546
|
-
| **`importance`** | <code><a href="#importance">Importance</a></code> | The level of interruption for notifications posted to this channel.
|
|
547
|
-
| **`visibility`** | <code><a href="#visibility">Visibility</a></code> | The visibility of notifications posted to this channel. This setting is for whether notifications posted to this channel appear on the lockscreen or not, and if so, whether they appear in a redacted form.
|
|
548
|
-
| **`lights`** | <code>boolean</code> | Whether notifications posted to this channel should display notification lights, on devices that support it.
|
|
549
|
-
| **`lightColor`** | <code>string</code> | The light color for notifications posted to this channel. Only supported if lights are enabled on this channel and the device supports it. Supported color formats are `#RRGGBB` and `#RRGGBBAA`.
|
|
550
|
-
| **`vibration`** | <code>boolean</code> | Whether notifications posted to this channel should vibrate.
|
|
540
|
+
| Prop | Type | Description | Since |
|
|
541
|
+
| ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
542
|
+
| **`id`** | <code>string</code> | The channel identifier. | 1.0.0 |
|
|
543
|
+
| **`name`** | <code>string</code> | The human-friendly name of this channel (presented to the user). | 1.0.0 |
|
|
544
|
+
| **`description`** | <code>string</code> | The description of this channel (presented to the user). | 1.0.0 |
|
|
545
|
+
| **`sound`** | <code>string</code> | The sound that should be played for notifications posted to this channel. Notification channels with an importance of at least `3` should have a sound. The file name of a sound file should be specified relative to the android app `res/raw` directory. If the sound is not provided, or the sound file is not found no sound will be used. | 1.0.0 |
|
|
546
|
+
| **`importance`** | <code><a href="#importance">Importance</a></code> | The level of interruption for notifications posted to this channel. | 1.0.0 |
|
|
547
|
+
| **`visibility`** | <code><a href="#visibility">Visibility</a></code> | The visibility of notifications posted to this channel. This setting is for whether notifications posted to this channel appear on the lockscreen or not, and if so, whether they appear in a redacted form. | 1.0.0 |
|
|
548
|
+
| **`lights`** | <code>boolean</code> | Whether notifications posted to this channel should display notification lights, on devices that support it. | 1.0.0 |
|
|
549
|
+
| **`lightColor`** | <code>string</code> | The light color for notifications posted to this channel. Only supported if lights are enabled on this channel and the device supports it. Supported color formats are `#RRGGBB` and `#RRGGBBAA`. | 1.0.0 |
|
|
550
|
+
| **`vibration`** | <code>boolean</code> | Whether notifications posted to this channel should vibrate. | 1.0.0 |
|
|
551
551
|
|
|
552
552
|
|
|
553
553
|
#### ListChannelsResult
|
package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotification.java
CHANGED
|
@@ -312,7 +312,7 @@ public class LocalNotification {
|
|
|
312
312
|
jsSchedule.put("at", schedule.getAt());
|
|
313
313
|
jsSchedule.put("every", schedule.getEvery());
|
|
314
314
|
jsSchedule.put("count", schedule.getCount());
|
|
315
|
-
jsSchedule.put("on", schedule.
|
|
315
|
+
jsSchedule.put("on", schedule.getOnObj());
|
|
316
316
|
jsSchedule.put("repeats", schedule.isRepeating());
|
|
317
317
|
jsNotification.put("schedule", jsSchedule);
|
|
318
318
|
}
|
|
@@ -20,7 +20,10 @@ public class LocalNotificationSchedule {
|
|
|
20
20
|
|
|
21
21
|
private Boolean whileIdle;
|
|
22
22
|
|
|
23
|
+
private JSObject scheduleObj;
|
|
24
|
+
|
|
23
25
|
public LocalNotificationSchedule(JSObject schedule) throws ParseException {
|
|
26
|
+
this.scheduleObj = schedule;
|
|
24
27
|
// Every specific unit of time (always constant)
|
|
25
28
|
buildEveryElement(schedule);
|
|
26
29
|
// Count of units of time from every to repeat on
|
|
@@ -72,6 +75,10 @@ public class LocalNotificationSchedule {
|
|
|
72
75
|
return on;
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
public JSObject getOnObj() {
|
|
79
|
+
return this.scheduleObj.getJSObject("on");
|
|
80
|
+
}
|
|
81
|
+
|
|
75
82
|
public void setOn(DateMatch on) {
|
|
76
83
|
this.on = on;
|
|
77
84
|
}
|
package/dist/docs.json
CHANGED
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"PluginListenerHandle",
|
|
238
238
|
"LocalNotificationSchema"
|
|
239
239
|
],
|
|
240
|
-
"slug": "addlistenerlocalnotificationreceived
|
|
240
|
+
"slug": "addlistenerlocalnotificationreceived"
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
"name": "addListener",
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
"PluginListenerHandle",
|
|
267
267
|
"ActionPerformed"
|
|
268
268
|
],
|
|
269
|
-
"slug": "addlistenerlocalnotificationactionperformed
|
|
269
|
+
"slug": "addlistenerlocalnotificationactionperformed"
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
272
|
"name": "removeAllListeners",
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
"name": "since"
|
|
449
449
|
}
|
|
450
450
|
],
|
|
451
|
-
"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 26
|
|
451
|
+
"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 < 26.\nFor Android 26+ 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.",
|
|
452
452
|
"complexTypes": [],
|
|
453
453
|
"type": "string | undefined"
|
|
454
454
|
},
|
|
@@ -2078,7 +2078,7 @@
|
|
|
2078
2078
|
"name": "example"
|
|
2079
2079
|
}
|
|
2080
2080
|
],
|
|
2081
|
-
"docs": "The sound that should be played for notifications posted to this channel.\n\nNotification channels with an importance of at least `3` should have a\nsound.\n\nThe file name of a sound file should be specified relative to the android\napp `res/raw` directory.",
|
|
2081
|
+
"docs": "The sound that should be played for notifications posted to this channel.\n\nNotification channels with an importance of at least `3` should have a\nsound.\n\nThe file name of a sound file should be specified relative to the android\napp `res/raw` directory.\n\nIf the sound is not provided, or the sound file is not found no sound will be used.",
|
|
2082
2082
|
"complexTypes": [],
|
|
2083
2083
|
"type": "string | undefined"
|
|
2084
2084
|
},
|
|
@@ -2431,7 +2431,7 @@
|
|
|
2431
2431
|
"name": "example"
|
|
2432
2432
|
}
|
|
2433
2433
|
],
|
|
2434
|
-
"docs": "Set the default notification sound for notifications.\n\nOn Android 26+ it sets the default channel sound and can't be\nchanged unless the app is uninstalled.\n\nOnly available for Android.",
|
|
2434
|
+
"docs": "Set the default notification sound for notifications.\n\nOn Android 26+ 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 21-25 and no sound on Android 26+.\n\nOnly available for Android.",
|
|
2435
2435
|
"complexTypes": [],
|
|
2436
2436
|
"type": "string | undefined"
|
|
2437
2437
|
}
|
|
@@ -33,6 +33,9 @@ declare module '@capacitor/cli' {
|
|
|
33
33
|
* On Android 26+ it sets the default channel sound and can't be
|
|
34
34
|
* changed unless the app is uninstalled.
|
|
35
35
|
*
|
|
36
|
+
* If the audio file is not found, it will result in the default system
|
|
37
|
+
* sound being played on Android 21-25 and no sound on Android 26+.
|
|
38
|
+
*
|
|
36
39
|
* Only available for Android.
|
|
37
40
|
*
|
|
38
41
|
* @since 1.0.0
|
|
@@ -476,7 +479,12 @@ export interface LocalNotificationSchema {
|
|
|
476
479
|
*
|
|
477
480
|
* Recommended format is `.wav` because is supported by both iOS and Android.
|
|
478
481
|
*
|
|
479
|
-
* Only available for iOS and Android 26
|
|
482
|
+
* Only available for iOS and Android < 26.
|
|
483
|
+
* For Android 26+ use channelId of a channel configured with the desired sound.
|
|
484
|
+
*
|
|
485
|
+
* If the sound file is not found, (i.e. empty string or wrong name)
|
|
486
|
+
* the default system notification sound will be used.
|
|
487
|
+
* If not provided, it will produce the default sound on Android and no sound on iOS.
|
|
480
488
|
*
|
|
481
489
|
* @since 1.0.0
|
|
482
490
|
*/
|
|
@@ -775,6 +783,8 @@ export interface Channel {
|
|
|
775
783
|
* The file name of a sound file should be specified relative to the android
|
|
776
784
|
* app `res/raw` directory.
|
|
777
785
|
*
|
|
786
|
+
* If the sound is not provided, or the sound file is not found no sound will be used.
|
|
787
|
+
*
|
|
778
788
|
* @since 1.0.0
|
|
779
789
|
* @example "jingle.wav"
|
|
780
790
|
*/
|
package/dist/plugin.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/local-notifications",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
34
|
"verify:web": "npm run build",
|
|
35
35
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
36
|
-
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint --
|
|
36
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
37
37
|
"eslint": "eslint . --ext ts",
|
|
38
38
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
39
39
|
"swiftlint": "node-swiftlint",
|
|
@@ -42,14 +42,13 @@
|
|
|
42
42
|
"clean": "rimraf ./dist",
|
|
43
43
|
"watch": "tsc --watch",
|
|
44
44
|
"prepublishOnly": "npm run build",
|
|
45
|
-
"postpublish": "npm run publish:cocoapod",
|
|
46
45
|
"publish:cocoapod": "pod trunk push ./CapacitorLocalNotifications.podspec --allow-warnings"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@capacitor/android": "^3.0.0",
|
|
50
49
|
"@capacitor/cli": "^3.0.0",
|
|
51
50
|
"@capacitor/core": "^3.0.0",
|
|
52
|
-
"@capacitor/docgen": "0.0.
|
|
51
|
+
"@capacitor/docgen": "0.0.18",
|
|
53
52
|
"@capacitor/ios": "^3.0.0",
|
|
54
53
|
"@ionic/eslint-config": "^0.3.0",
|
|
55
54
|
"@ionic/prettier-config": "~1.0.1",
|
|
@@ -81,5 +80,5 @@
|
|
|
81
80
|
"publishConfig": {
|
|
82
81
|
"access": "public"
|
|
83
82
|
},
|
|
84
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "e5b333320426ee120d4504c68c02bd5538b21c51"
|
|
85
84
|
}
|