@capacitor/local-notifications 6.1.1 → 7.0.0-alpha.2
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 +2 -2
- package/README.md +7 -0
- package/android/build.gradle +9 -9
- package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java +2 -2
- package/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java +17 -19
- package/dist/plugin.cjs.js +0 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +0 -2
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -10
|
@@ -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 = '14.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapacitorLocalNotifications",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorLocalNotifications",
|
|
10
10
|
targets: ["LocalNotificationsPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git",
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ npx cap sync
|
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Android
|
|
13
|
+
|
|
13
14
|
Android 13 requires a permission check in order to send notifications. You are required to call `checkPermissions()` and `requestPermissions()` accordingly.
|
|
14
15
|
|
|
15
16
|
On Android 12 and older it won't show a prompt and will just return as granted.
|
|
@@ -24,6 +25,12 @@ Note that even if the permission is present, users can still disable exact notif
|
|
|
24
25
|
|
|
25
26
|
On Android 14, there is a new permission called `USE_EXACT_ALARM`. Use this permission to use exact alarms without needing to request permission from the user. This should only be used if the use of exact alarms is central to your app's functionality. Read more about the implications of using this permission [here](https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM).
|
|
26
27
|
|
|
28
|
+
From Android 15 onwards, users can install an app in the [Private space](https://developer.android.com/about/versions/15/features#private-space). Users can lock their private space at any time, which means that push notifications are not shown until the user unlocks it.
|
|
29
|
+
|
|
30
|
+
It is not possible to detect if an app is installed in the private space. Therefore, if your app shows any critical notifications, inform your users to avoid installing the app in the private space.
|
|
31
|
+
|
|
32
|
+
For more information about the behavior changes of your app related to the private space, refer to [Android documentation](https://developer.android.com/about/versions/15/behavior-changes-all#private-space-changes).
|
|
33
|
+
|
|
27
34
|
## Configuration
|
|
28
35
|
|
|
29
36
|
<docgen-config>
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
3
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
4
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
5
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
6
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
4
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
5
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
6
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -15,7 +15,7 @@ buildscript {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
dependencies {
|
|
18
|
-
classpath 'com.android.tools.build:gradle:8.2
|
|
18
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
19
19
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
20
20
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
21
21
|
}
|
|
@@ -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 : 35
|
|
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 : 23
|
|
37
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
38
38
|
versionCode 1
|
|
39
39
|
versionName "1.0"
|
|
40
40
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -49,8 +49,8 @@ android {
|
|
|
49
49
|
abortOnError false
|
|
50
50
|
}
|
|
51
51
|
compileOptions {
|
|
52
|
-
sourceCompatibility JavaVersion.
|
|
53
|
-
targetCompatibility JavaVersion.
|
|
52
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
53
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
54
54
|
}
|
|
55
55
|
publishing {
|
|
56
56
|
singleVariant("release")
|
|
@@ -382,13 +382,13 @@ public class LocalNotificationManager {
|
|
|
382
382
|
"Capacitor/LocalNotification",
|
|
383
383
|
"Exact alarms not allowed in user settings. Notification scheduled with non-exact alarm."
|
|
384
384
|
);
|
|
385
|
-
if (
|
|
385
|
+
if (schedule.allowWhileIdle()) {
|
|
386
386
|
alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent);
|
|
387
387
|
} else {
|
|
388
388
|
alarmManager.set(AlarmManager.RTC, trigger, pendingIntent);
|
|
389
389
|
}
|
|
390
390
|
} else {
|
|
391
|
-
if (
|
|
391
|
+
if (schedule.allowWhileIdle()) {
|
|
392
392
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent);
|
|
393
393
|
} else {
|
|
394
394
|
alarmManager.setExact(AlarmManager.RTC, trigger, pendingIntent);
|
|
@@ -123,33 +123,31 @@ public class LocalNotificationsPlugin extends Plugin {
|
|
|
123
123
|
@PluginMethod
|
|
124
124
|
public void getDeliveredNotifications(PluginCall call) {
|
|
125
125
|
JSArray notifications = new JSArray();
|
|
126
|
-
|
|
127
|
-
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
|
|
126
|
+
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
for (StatusBarNotification notif : activeNotifications) {
|
|
129
|
+
JSObject jsNotif = new JSObject();
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
jsNotif.put("id", notif.getId());
|
|
132
|
+
jsNotif.put("tag", notif.getTag());
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
Notification notification = notif.getNotification();
|
|
135
|
+
if (notification != null) {
|
|
136
|
+
jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
|
|
137
|
+
jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
|
|
138
|
+
jsNotif.put("group", notification.getGroup());
|
|
139
|
+
jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
JSObject extras = new JSObject();
|
|
143
142
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
jsNotif.put("data", extras);
|
|
143
|
+
for (String key : notification.extras.keySet()) {
|
|
144
|
+
extras.put(key, notification.extras.getString(key));
|
|
149
145
|
}
|
|
150
146
|
|
|
151
|
-
|
|
147
|
+
jsNotif.put("data", extras);
|
|
152
148
|
}
|
|
149
|
+
|
|
150
|
+
notifications.put(jsNotif);
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
JSObject result = new JSObject();
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport var Weekday;\n(function (Weekday) {\n Weekday[Weekday[\"Sunday\"] = 1] = \"Sunday\";\n Weekday[Weekday[\"Monday\"] = 2] = \"Monday\";\n Weekday[Weekday[\"Tuesday\"] = 3] = \"Tuesday\";\n Weekday[Weekday[\"Wednesday\"] = 4] = \"Wednesday\";\n Weekday[Weekday[\"Thursday\"] = 5] = \"Thursday\";\n Weekday[Weekday[\"Friday\"] = 6] = \"Friday\";\n Weekday[Weekday[\"Saturday\"] = 7] = \"Saturday\";\n})(Weekday || (Weekday = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst LocalNotifications = registerPlugin('LocalNotifications', {\n web: () => import('./web').then(m => new m.LocalNotificationsWeb()),\n});\nexport * from './definitions';\nexport { LocalNotifications };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LocalNotificationsWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pending = [];\n this.deliveredNotifications = [];\n this.hasNotificationSupport = () => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\n if (Notification.permission !== 'granted') {\n // don't test for `new Notification` if permission has already been granted\n // otherwise this sends a real notification on supported browsers\n try {\n new Notification('');\n }\n catch (e) {\n if (e.name == 'TypeError') {\n return false;\n }\n }\n }\n return true;\n };\n }\n async getDeliveredNotifications() {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema = {\n title: notification.title,\n id: parseInt(notification.tag),\n body: notification.body,\n };\n deliveredSchemas.push(deliveredSchema);\n }\n return {\n notifications: deliveredSchemas,\n };\n }\n async removeDeliveredNotifications(delivered) {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find(n => n.tag === String(toRemove.id));\n found === null || found === void 0 ? void 0 : found.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications() {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async deleteChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async listChannels() {\n throw this.unimplemented('Not implemented on web.');\n }\n async schedule(options) {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n return {\n notifications: options.notifications.map(notification => ({\n id: notification.id,\n })),\n };\n }\n async getPending() {\n return {\n notifications: this.pending,\n };\n }\n async registerActionTypes() {\n throw this.unimplemented('Not implemented on web.');\n }\n async cancel(pending) {\n this.pending = this.pending.filter(notification => !pending.notifications.find(n => n.id === notification.id));\n }\n async areEnabled() {\n const { display } = await this.checkPermissions();\n return {\n value: display === 'granted',\n };\n }\n async changeExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n return { display };\n }\n async checkPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(Notification.permission);\n return { display };\n }\n transformNotificationPermission(permission) {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n sendPending() {\n var _a;\n const toRemove = [];\n const now = new Date().getTime();\n for (const notification of this.pending) {\n if (((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) &&\n notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n this.pending = this.pending.filter(notification => !toRemove.find(n => n === notification));\n }\n sendNotification(notification) {\n var _a;\n if ((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n buildNotification(notification) {\n const localNotification = new Notification(notification.title, {\n body: notification.body,\n tag: String(notification.id),\n });\n localNotification.addEventListener('click', this.onClick.bind(this, notification), false);\n localNotification.addEventListener('show', this.onShow.bind(this, notification), false);\n localNotification.addEventListener('close', () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n }, false);\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n onClick(notification) {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n onShow(notification) {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Weekday","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACWA,yBAAQ;AACnB,CAAC,UAAU,OAAO,EAAE;AACpB,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC9C,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC9C,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;AAChD,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;AACpD,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAClD,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC9C,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAClD,CAAC,EAAEA,eAAO,KAAKA,eAAO,GAAG,EAAE,CAAC,CAAC;;ACZxB,MAAC,kBAAkB,GAAGC,mBAAc,CAAC,oBAAoB,EAAE;AAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACvE,CAAC;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,YAAY,CAAC,EAAE,CAAC;AACxC,SAAS,CAAC,CAAC;AACX,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;AAClG,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;AAChG,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM;AAC1D,YAAY,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1F,SAAS,EAAE,KAAK,CAAC,CAAC;AAClB,QAAQ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC5D,QAAQ,OAAO,iBAAiB,CAAC;AACjC,KAAK;AACL,IAAI,OAAO,CAAC,YAAY,EAAE;AAC1B,QAAQ,MAAM,IAAI,GAAG;AACrB,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,YAAY;AACxB,SAAS,CAAC;AACV,QAAQ,IAAI,CAAC,eAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,CAAC,YAAY,EAAE;AACzB,QAAQ,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC,CAAC;AACxE,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport var Weekday;\n(function (Weekday) {\n Weekday[Weekday[\"Sunday\"] = 1] = \"Sunday\";\n Weekday[Weekday[\"Monday\"] = 2] = \"Monday\";\n Weekday[Weekday[\"Tuesday\"] = 3] = \"Tuesday\";\n Weekday[Weekday[\"Wednesday\"] = 4] = \"Wednesday\";\n Weekday[Weekday[\"Thursday\"] = 5] = \"Thursday\";\n Weekday[Weekday[\"Friday\"] = 6] = \"Friday\";\n Weekday[Weekday[\"Saturday\"] = 7] = \"Saturday\";\n})(Weekday || (Weekday = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst LocalNotifications = registerPlugin('LocalNotifications', {\n web: () => import('./web').then(m => new m.LocalNotificationsWeb()),\n});\nexport * from './definitions';\nexport { LocalNotifications };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LocalNotificationsWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pending = [];\n this.deliveredNotifications = [];\n this.hasNotificationSupport = () => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\n if (Notification.permission !== 'granted') {\n // don't test for `new Notification` if permission has already been granted\n // otherwise this sends a real notification on supported browsers\n try {\n new Notification('');\n }\n catch (e) {\n if (e.name == 'TypeError') {\n return false;\n }\n }\n }\n return true;\n };\n }\n async getDeliveredNotifications() {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema = {\n title: notification.title,\n id: parseInt(notification.tag),\n body: notification.body,\n };\n deliveredSchemas.push(deliveredSchema);\n }\n return {\n notifications: deliveredSchemas,\n };\n }\n async removeDeliveredNotifications(delivered) {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find(n => n.tag === String(toRemove.id));\n found === null || found === void 0 ? void 0 : found.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications() {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async deleteChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async listChannels() {\n throw this.unimplemented('Not implemented on web.');\n }\n async schedule(options) {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n return {\n notifications: options.notifications.map(notification => ({\n id: notification.id,\n })),\n };\n }\n async getPending() {\n return {\n notifications: this.pending,\n };\n }\n async registerActionTypes() {\n throw this.unimplemented('Not implemented on web.');\n }\n async cancel(pending) {\n this.pending = this.pending.filter(notification => !pending.notifications.find(n => n.id === notification.id));\n }\n async areEnabled() {\n const { display } = await this.checkPermissions();\n return {\n value: display === 'granted',\n };\n }\n async changeExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n return { display };\n }\n async checkPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(Notification.permission);\n return { display };\n }\n transformNotificationPermission(permission) {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n sendPending() {\n var _a;\n const toRemove = [];\n const now = new Date().getTime();\n for (const notification of this.pending) {\n if (((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) &&\n notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n this.pending = this.pending.filter(notification => !toRemove.find(n => n === notification));\n }\n sendNotification(notification) {\n var _a;\n if ((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n buildNotification(notification) {\n const localNotification = new Notification(notification.title, {\n body: notification.body,\n tag: String(notification.id),\n });\n localNotification.addEventListener('click', this.onClick.bind(this, notification), false);\n localNotification.addEventListener('show', this.onShow.bind(this, notification), false);\n localNotification.addEventListener('close', () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n }, false);\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n onClick(notification) {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n onShow(notification) {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Weekday","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACWA;AACX,CAAC,UAAU,OAAO,EAAE;AACpB,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AAC/C,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;AACnD,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AACjD,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AACjD,CAAC,EAAEA,eAAO,KAAKA,eAAO,GAAG,EAAE,CAAC,CAAC;;ACZxB,MAAC,kBAAkB,GAAGC,mBAAc,CAAC,oBAAoB,EAAE;AAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;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AAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC;AAC3D,QAAQ,OAAO,iBAAiB;AAChC;AACA,IAAI,OAAO,CAAC,YAAY,EAAE;AAC1B,QAAQ,MAAM,IAAI,GAAG;AACrB,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,YAAY;AACxB,SAAS;AACT,QAAQ,IAAI,CAAC,eAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC;AACtE;AACA,IAAI,MAAM,CAAC,YAAY,EAAE;AACzB,QAAQ,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC;AACvE;AACA;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport var Weekday;\n(function (Weekday) {\n Weekday[Weekday[\"Sunday\"] = 1] = \"Sunday\";\n Weekday[Weekday[\"Monday\"] = 2] = \"Monday\";\n Weekday[Weekday[\"Tuesday\"] = 3] = \"Tuesday\";\n Weekday[Weekday[\"Wednesday\"] = 4] = \"Wednesday\";\n Weekday[Weekday[\"Thursday\"] = 5] = \"Thursday\";\n Weekday[Weekday[\"Friday\"] = 6] = \"Friday\";\n Weekday[Weekday[\"Saturday\"] = 7] = \"Saturday\";\n})(Weekday || (Weekday = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst LocalNotifications = registerPlugin('LocalNotifications', {\n web: () => import('./web').then(m => new m.LocalNotificationsWeb()),\n});\nexport * from './definitions';\nexport { LocalNotifications };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LocalNotificationsWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pending = [];\n this.deliveredNotifications = [];\n this.hasNotificationSupport = () => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\n if (Notification.permission !== 'granted') {\n // don't test for `new Notification` if permission has already been granted\n // otherwise this sends a real notification on supported browsers\n try {\n new Notification('');\n }\n catch (e) {\n if (e.name == 'TypeError') {\n return false;\n }\n }\n }\n return true;\n };\n }\n async getDeliveredNotifications() {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema = {\n title: notification.title,\n id: parseInt(notification.tag),\n body: notification.body,\n };\n deliveredSchemas.push(deliveredSchema);\n }\n return {\n notifications: deliveredSchemas,\n };\n }\n async removeDeliveredNotifications(delivered) {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find(n => n.tag === String(toRemove.id));\n found === null || found === void 0 ? void 0 : found.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications() {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async deleteChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async listChannels() {\n throw this.unimplemented('Not implemented on web.');\n }\n async schedule(options) {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n return {\n notifications: options.notifications.map(notification => ({\n id: notification.id,\n })),\n };\n }\n async getPending() {\n return {\n notifications: this.pending,\n };\n }\n async registerActionTypes() {\n throw this.unimplemented('Not implemented on web.');\n }\n async cancel(pending) {\n this.pending = this.pending.filter(notification => !pending.notifications.find(n => n.id === notification.id));\n }\n async areEnabled() {\n const { display } = await this.checkPermissions();\n return {\n value: display === 'granted',\n };\n }\n async changeExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n return { display };\n }\n async checkPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(Notification.permission);\n return { display };\n }\n transformNotificationPermission(permission) {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n sendPending() {\n var _a;\n const toRemove = [];\n const now = new Date().getTime();\n for (const notification of this.pending) {\n if (((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) &&\n notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n this.pending = this.pending.filter(notification => !toRemove.find(n => n === notification));\n }\n sendNotification(notification) {\n var _a;\n if ((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n buildNotification(notification) {\n const localNotification = new Notification(notification.title, {\n body: notification.body,\n tag: String(notification.id),\n });\n localNotification.addEventListener('click', this.onClick.bind(this, notification), false);\n localNotification.addEventListener('show', this.onShow.bind(this, notification), false);\n localNotification.addEventListener('close', () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n }, false);\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n onClick(notification) {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n onShow(notification) {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Weekday","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;AACWA,6BAAQ;IACnB,CAAC,UAAU,OAAO,EAAE;IACpB,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAA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AI,CAAC,CAAC;IAC1F,SAAS,EAAE,KAAK,CAAC,CAAC;IAClB,QAAQ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC5D,QAAQ,OAAO,iBAAiB,CAAC;IACjC,KAAK;IACL,IAAI,OAAO,CAAC,YAAY,EAAE;IAC1B,QAAQ,MAAM,IAAI,GAAG;IACrB,YAAY,QAAQ,EAAE,KAAK;IAC3B,YAAY,YAAY;IACxB,SAAS,CAAC;IACV,QAAQ,IAAI,CAAC,eAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC;IACvE,KAAK;IACL,IAAI,MAAM,CAAC,YAAY,EAAE;IACzB,QAAQ,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC,CAAC;IACxE,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Day of the week. Used for scheduling notifications on a particular weekday.\n */\nexport var Weekday;\n(function (Weekday) {\n Weekday[Weekday[\"Sunday\"] = 1] = \"Sunday\";\n Weekday[Weekday[\"Monday\"] = 2] = \"Monday\";\n Weekday[Weekday[\"Tuesday\"] = 3] = \"Tuesday\";\n Weekday[Weekday[\"Wednesday\"] = 4] = \"Wednesday\";\n Weekday[Weekday[\"Thursday\"] = 5] = \"Thursday\";\n Weekday[Weekday[\"Friday\"] = 6] = \"Friday\";\n Weekday[Weekday[\"Saturday\"] = 7] = \"Saturday\";\n})(Weekday || (Weekday = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst LocalNotifications = registerPlugin('LocalNotifications', {\n web: () => import('./web').then(m => new m.LocalNotificationsWeb()),\n});\nexport * from './definitions';\nexport { LocalNotifications };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LocalNotificationsWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pending = [];\n this.deliveredNotifications = [];\n this.hasNotificationSupport = () => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\n if (Notification.permission !== 'granted') {\n // don't test for `new Notification` if permission has already been granted\n // otherwise this sends a real notification on supported browsers\n try {\n new Notification('');\n }\n catch (e) {\n if (e.name == 'TypeError') {\n return false;\n }\n }\n }\n return true;\n };\n }\n async getDeliveredNotifications() {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema = {\n title: notification.title,\n id: parseInt(notification.tag),\n body: notification.body,\n };\n deliveredSchemas.push(deliveredSchema);\n }\n return {\n notifications: deliveredSchemas,\n };\n }\n async removeDeliveredNotifications(delivered) {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find(n => n.tag === String(toRemove.id));\n found === null || found === void 0 ? void 0 : found.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications() {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async deleteChannel() {\n throw this.unimplemented('Not implemented on web.');\n }\n async listChannels() {\n throw this.unimplemented('Not implemented on web.');\n }\n async schedule(options) {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n return {\n notifications: options.notifications.map(notification => ({\n id: notification.id,\n })),\n };\n }\n async getPending() {\n return {\n notifications: this.pending,\n };\n }\n async registerActionTypes() {\n throw this.unimplemented('Not implemented on web.');\n }\n async cancel(pending) {\n this.pending = this.pending.filter(notification => !pending.notifications.find(n => n.id === notification.id));\n }\n async areEnabled() {\n const { display } = await this.checkPermissions();\n return {\n value: display === 'granted',\n };\n }\n async changeExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkExactNotificationSetting() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n return { display };\n }\n async checkPermissions() {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n const display = this.transformNotificationPermission(Notification.permission);\n return { display };\n }\n transformNotificationPermission(permission) {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n sendPending() {\n var _a;\n const toRemove = [];\n const now = new Date().getTime();\n for (const notification of this.pending) {\n if (((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) &&\n notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n this.pending = this.pending.filter(notification => !toRemove.find(n => n === notification));\n }\n sendNotification(notification) {\n var _a;\n if ((_a = notification.schedule) === null || _a === void 0 ? void 0 : _a.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n buildNotification(notification) {\n const localNotification = new Notification(notification.title, {\n body: notification.body,\n tag: String(notification.id),\n });\n localNotification.addEventListener('click', this.onClick.bind(this, notification), false);\n localNotification.addEventListener('show', this.onShow.bind(this, notification), false);\n localNotification.addEventListener('close', () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n }, false);\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n onClick(notification) {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n onShow(notification) {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Weekday","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,OAAO,EAAE;IACpB,IAAI,OAAO,CAAC,OAA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|
"name": "@capacitor/local-notifications",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.2",
|
|
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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
34
|
-
"verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -
|
|
34
|
+
"verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -destination generic/platform=iOS",
|
|
35
35
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
36
36
|
"verify:web": "npm run build",
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api LocalNotificationsPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
43
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"watch": "tsc --watch",
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"publish:cocoapod": "pod trunk push ./CapacitorLocalNotifications.podspec --allow-warnings"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@capacitor/android": "
|
|
50
|
+
"@capacitor/android": "next",
|
|
51
51
|
"@capacitor/cli": "^6.0.0",
|
|
52
|
-
"@capacitor/core": "
|
|
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",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"prettier": "~2.3.0",
|
|
60
60
|
"prettier-plugin-java": "~1.0.2",
|
|
61
|
-
"rimraf": "^
|
|
62
|
-
"rollup": "^
|
|
61
|
+
"rimraf": "^6.0.1",
|
|
62
|
+
"rollup": "^4.26.0",
|
|
63
63
|
"swiftlint": "^1.0.1",
|
|
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": "023f53b42a81049b7cdef6c7b0102b85b4df1c01"
|
|
86
86
|
}
|