@capacitor/local-notifications 7.0.3 → 8.0.0-alpha.1
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/CapacitorLocalNotifications.podspec +1 -1
- package/Package.swift +1 -1
- package/README.md +37 -37
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationRestoreReceiver.java +2 -7
- package/dist/docs.json +4 -4
- package/dist/esm/definitions.d.ts +5 -7
- package/dist/esm/definitions.js.map +1 -1
- package/package.json +7 -7
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'local-notifications/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
package/README.md
CHANGED
|
@@ -38,11 +38,11 @@ For more information about the behavior changes of your app related to the priva
|
|
|
38
38
|
|
|
39
39
|
On Android, the Local Notifications can be configured with the following options:
|
|
40
40
|
|
|
41
|
-
| Prop | Type | Description
|
|
42
|
-
| --------------- | ------------------- |
|
|
43
|
-
| **`smallIcon`** | <code>string</code> | Set the default status bar icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android.
|
|
44
|
-
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android.
|
|
45
|
-
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android
|
|
41
|
+
| Prop | Type | Description | Since |
|
|
42
|
+
| --------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
|
|
43
|
+
| **`smallIcon`** | <code>string</code> | Set the default status bar icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
|
|
44
|
+
| **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 |
|
|
45
|
+
| **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 8+ it sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in the default system sound being played on Android 7.x and no sound on Android 8+. Only available for Android. | 1.0.0 |
|
|
46
46
|
|
|
47
47
|
### Examples
|
|
48
48
|
|
|
@@ -453,30 +453,30 @@ The object that describes a local notification.
|
|
|
453
453
|
|
|
454
454
|
#### LocalNotificationSchema
|
|
455
455
|
|
|
456
|
-
| Prop | Type | Description
|
|
457
|
-
| ---------------------- | --------------------------------------------- |
|
|
458
|
-
| **`title`** | <code>string</code> | The title of the notification.
|
|
459
|
-
| **`body`** | <code>string</code> | The body of the notification, shown below the title.
|
|
460
|
-
| **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style.
|
|
461
|
-
| **`summaryText`** | <code>string</code> | Used to set the summary text detail in inbox and big text notification styles. Only available for Android.
|
|
462
|
-
| **`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.
|
|
463
|
-
| **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time.
|
|
464
|
-
| **`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
|
|
465
|
-
| **`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.
|
|
466
|
-
| **`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.
|
|
467
|
-
| **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android.
|
|
468
|
-
| **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification.
|
|
469
|
-
| **`actionTypeId`** | <code>string</code> | Associate an action type with this notification.
|
|
470
|
-
| **`extra`** | <code>any</code> | Set extra data to store within this notification.
|
|
471
|
-
| **`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.
|
|
472
|
-
| **`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.
|
|
473
|
-
| **`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.
|
|
474
|
-
| **`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`.
|
|
475
|
-
| **`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
|
|
476
|
-
| **`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.
|
|
477
|
-
| **`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.
|
|
478
|
-
| **`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.
|
|
479
|
-
| **`silent`** | <code>boolean</code> | If true, notification will not appear while app is in the foreground. Only available for iOS.
|
|
456
|
+
| Prop | Type | Description | Since |
|
|
457
|
+
| ---------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
458
|
+
| **`title`** | <code>string</code> | The title of the notification. | 1.0.0 |
|
|
459
|
+
| **`body`** | <code>string</code> | The body of the notification, shown below the title. | 1.0.0 |
|
|
460
|
+
| **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
|
|
461
|
+
| **`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 |
|
|
462
|
+
| **`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 |
|
|
463
|
+
| **`schedule`** | <code><a href="#schedule">Schedule</a></code> | <a href="#schedule">Schedule</a> this notification for a later time. | 1.0.0 |
|
|
464
|
+
| **`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 |
|
|
465
|
+
| **`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 |
|
|
466
|
+
| **`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 |
|
|
467
|
+
| **`iconColor`** | <code>string</code> | Set the color of the notification icon. Only available for Android. | 1.0.0 |
|
|
468
|
+
| **`attachments`** | <code>Attachment[]</code> | Set attachments for this notification. | 1.0.0 |
|
|
469
|
+
| **`actionTypeId`** | <code>string</code> | Associate an action type with this notification. | 1.0.0 |
|
|
470
|
+
| **`extra`** | <code>any</code> | Set extra data to store within this notification. | 1.0.0 |
|
|
471
|
+
| **`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 |
|
|
472
|
+
| **`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 |
|
|
473
|
+
| **`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 |
|
|
474
|
+
| **`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 |
|
|
475
|
+
| **`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 |
|
|
476
|
+
| **`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 |
|
|
477
|
+
| **`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 |
|
|
478
|
+
| **`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 |
|
|
479
|
+
| **`silent`** | <code>boolean</code> | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
|
|
480
480
|
|
|
481
481
|
|
|
482
482
|
#### Schedule
|
|
@@ -485,14 +485,14 @@ Represents a schedule for a notification.
|
|
|
485
485
|
|
|
486
486
|
Use either `at`, `on`, or `every` to schedule notifications.
|
|
487
487
|
|
|
488
|
-
| Prop | Type | Description
|
|
489
|
-
| -------------------- | ------------------------------------------------------- |
|
|
490
|
-
| **`at`** | <code><a href="#date">Date</a></code> | <a href="#schedule">Schedule</a> a notification at a specific date and time.
|
|
491
|
-
| **`repeats`** | <code>boolean</code> | Repeat delivery of this notification at the date and time specified by `at`. Only available for iOS and Android.
|
|
492
|
-
| **`allowWhileIdle`** | <code>boolean</code> | Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)
|
|
493
|
-
| **`on`** | <code><a href="#scheduleon">ScheduleOn</a></code> | <a href="#schedule">Schedule</a> a notification on particular interval(s). This is similar to scheduling [cron](https://en.wikipedia.org/wiki/Cron) jobs. Only available for iOS and Android.
|
|
494
|
-
| **`every`** | <code><a href="#scheduleevery">ScheduleEvery</a></code> | <a href="#schedule">Schedule</a> a notification on a particular interval.
|
|
495
|
-
| **`count`** | <code>number</code> | Limit the number times a notification is delivered by the interval specified by `every`.
|
|
488
|
+
| Prop | Type | Description | Since |
|
|
489
|
+
| -------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
490
|
+
| **`at`** | <code><a href="#date">Date</a></code> | <a href="#schedule">Schedule</a> a notification at a specific date and time. | 1.0.0 |
|
|
491
|
+
| **`repeats`** | <code>boolean</code> | Repeat delivery of this notification at the date and time specified by `at`. Only available for iOS and Android. | 1.0.0 |
|
|
492
|
+
| **`allowWhileIdle`** | <code>boolean</code> | Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby) 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). | 1.0.0 |
|
|
493
|
+
| **`on`** | <code><a href="#scheduleon">ScheduleOn</a></code> | <a href="#schedule">Schedule</a> a notification on particular interval(s). This is similar to scheduling [cron](https://en.wikipedia.org/wiki/Cron) jobs. Only available for iOS and Android. | 1.0.0 |
|
|
494
|
+
| **`every`** | <code><a href="#scheduleevery">ScheduleEvery</a></code> | <a href="#schedule">Schedule</a> a notification on a particular interval. | 1.0.0 |
|
|
495
|
+
| **`count`** | <code>number</code> | Limit the number times a notification is delivered by the interval specified by `every`. | 1.0.0 |
|
|
496
496
|
|
|
497
497
|
|
|
498
498
|
#### Date
|
package/android/build.gradle
CHANGED
|
@@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
31
31
|
|
|
32
32
|
android {
|
|
33
33
|
namespace "com.capacitorjs.plugins.localnotifications"
|
|
34
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
34
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
35
35
|
defaultConfig {
|
|
36
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
37
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
36
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
37
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
38
38
|
versionCode 1
|
|
39
39
|
versionName "1.0"
|
|
40
40
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
package com.capacitorjs.plugins.localnotifications;
|
|
2
2
|
|
|
3
|
-
import static android.os.Build.VERSION.SDK_INT;
|
|
4
|
-
|
|
5
3
|
import android.content.BroadcastReceiver;
|
|
6
4
|
import android.content.Context;
|
|
7
5
|
import android.content.Intent;
|
|
8
|
-
import android.os.Build;
|
|
9
6
|
import android.os.UserManager;
|
|
10
7
|
import com.getcapacitor.CapConfig;
|
|
11
8
|
import java.util.ArrayList;
|
|
@@ -16,10 +13,8 @@ public class LocalNotificationRestoreReceiver extends BroadcastReceiver {
|
|
|
16
13
|
|
|
17
14
|
@Override
|
|
18
15
|
public void onReceive(Context context, Intent intent) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (um == null || !um.isUserUnlocked()) return;
|
|
22
|
-
}
|
|
16
|
+
UserManager um = context.getSystemService(UserManager.class);
|
|
17
|
+
if (um == null || !um.isUserUnlocked()) return;
|
|
23
18
|
|
|
24
19
|
NotificationStorage storage = new NotificationStorage(context);
|
|
25
20
|
List<String> ids = storage.getSavedNotificationIds();
|
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
|
|
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.",
|
|
539
539
|
"complexTypes": [],
|
|
540
540
|
"type": "string | undefined"
|
|
541
541
|
},
|
|
@@ -669,7 +669,7 @@
|
|
|
669
669
|
"name": "since"
|
|
670
670
|
}
|
|
671
671
|
],
|
|
672
|
-
"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
|
|
672
|
+
"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+.",
|
|
673
673
|
"complexTypes": [],
|
|
674
674
|
"type": "string | undefined"
|
|
675
675
|
},
|
|
@@ -769,7 +769,7 @@
|
|
|
769
769
|
"name": "since"
|
|
770
770
|
}
|
|
771
771
|
],
|
|
772
|
-
"docs": "Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)\n\
|
|
772
|
+
"docs": "Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)\n\nNote 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).",
|
|
773
773
|
"complexTypes": [],
|
|
774
774
|
"type": "boolean | undefined"
|
|
775
775
|
},
|
|
@@ -2782,7 +2782,7 @@
|
|
|
2782
2782
|
"name": "example"
|
|
2783
2783
|
}
|
|
2784
2784
|
],
|
|
2785
|
-
"docs": "Set the default notification sound for notifications.\n\nOn Android
|
|
2785
|
+
"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.",
|
|
2786
2786
|
"complexTypes": [],
|
|
2787
2787
|
"type": "string | undefined"
|
|
2788
2788
|
}
|
|
@@ -30,11 +30,11 @@ declare module '@capacitor/cli' {
|
|
|
30
30
|
/**
|
|
31
31
|
* Set the default notification sound for notifications.
|
|
32
32
|
*
|
|
33
|
-
* On Android
|
|
33
|
+
* On Android 8+ it sets the default channel sound and can't be
|
|
34
34
|
* changed unless the app is uninstalled.
|
|
35
35
|
*
|
|
36
36
|
* If the audio file is not found, it will result in the default system
|
|
37
|
-
* sound being played on Android
|
|
37
|
+
* sound being played on Android 7.x and no sound on Android 8+.
|
|
38
38
|
*
|
|
39
39
|
* Only available for Android.
|
|
40
40
|
*
|
|
@@ -523,8 +523,8 @@ export interface LocalNotificationSchema {
|
|
|
523
523
|
*
|
|
524
524
|
* Recommended format is `.wav` because is supported by both iOS and Android.
|
|
525
525
|
*
|
|
526
|
-
* Only available for iOS and Android
|
|
527
|
-
* For Android
|
|
526
|
+
* Only available for iOS and Android 7.x.
|
|
527
|
+
* For Android 8+ use channelId of a channel configured with the desired sound.
|
|
528
528
|
*
|
|
529
529
|
* If the sound file is not found, (i.e. empty string or wrong name)
|
|
530
530
|
* the default system notification sound will be used.
|
|
@@ -643,7 +643,7 @@ export interface LocalNotificationSchema {
|
|
|
643
643
|
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
644
644
|
* with the provided value.
|
|
645
645
|
*
|
|
646
|
-
* Only available for Android
|
|
646
|
+
* Only available for Android 8+.
|
|
647
647
|
*
|
|
648
648
|
* @since 1.0.0
|
|
649
649
|
*/
|
|
@@ -717,8 +717,6 @@ export interface Schedule {
|
|
|
717
717
|
/**
|
|
718
718
|
* Allow this notification to fire while in [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby)
|
|
719
719
|
*
|
|
720
|
-
* Only available for Android 23+.
|
|
721
|
-
*
|
|
722
720
|
* 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).
|
|
723
721
|
*
|
|
724
722
|
* @since 1.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAomCxC;;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\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * On Android, 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 26+ 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 21-25 and no sound on Android 26+.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n * @example \"beep.wav\"\n */\n sound?: string;\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(\n delivered: DeliveredNotifications,\n ): 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 < 26.\n * For Android 26+ 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 */\n summaryArgument?: string;\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 26+.\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 * Only available for Android 23+.\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 =\n | 'year'\n | 'month'\n | 'two-weeks'\n | 'week'\n | 'day'\n | 'hour'\n | 'minute'\n | 'second';\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 = 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;AAkmCxC;;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\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * On Android, 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}\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(\n delivered: DeliveredNotifications,\n ): 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 */\n summaryArgument?: string;\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 =\n | 'year'\n | 'month'\n | 'two-weeks'\n | 'week'\n | 'day'\n | 'hour'\n | 'minute'\n | 'second';\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 = 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/local-notifications",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
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": "
|
|
51
|
-
"@capacitor/cli": "
|
|
52
|
-
"@capacitor/core": "
|
|
50
|
+
"@capacitor/android": "next",
|
|
51
|
+
"@capacitor/cli": "next",
|
|
52
|
+
"@capacitor/core": "next",
|
|
53
53
|
"@capacitor/docgen": "0.2.2",
|
|
54
|
-
"@capacitor/ios": "
|
|
54
|
+
"@capacitor/ios": "next",
|
|
55
55
|
"@ionic/eslint-config": "^0.4.0",
|
|
56
56
|
"@ionic/prettier-config": "~1.0.1",
|
|
57
57
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"typescript": "~4.1.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@capacitor/core": "
|
|
67
|
+
"@capacitor/core": "next"
|
|
68
68
|
},
|
|
69
69
|
"prettier": "@ionic/prettier-config",
|
|
70
70
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "4c2f39a8fc78578c919a81ba410d6a37e70152d0"
|
|
86
86
|
}
|