@capacitor/local-notifications 8.0.0-dev-2434-20251114T165054.0 → 8.0.0-dev-2440-20251114T165306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Package.swift CHANGED
@@ -10,7 +10,7 @@ let package = Package(
10
10
  targets: ["LocalNotificationsPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0-beta")
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
14
14
  ],
15
15
  targets: [
16
16
  .target(
@@ -756,7 +756,7 @@ export interface ScheduleOn {
756
756
  minute?: number;
757
757
  second?: number;
758
758
  }
759
- export declare type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';
759
+ export type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';
760
760
  export interface ListChannelsResult {
761
761
  /**
762
762
  * The list of notification channels.
@@ -1008,74 +1008,74 @@ export declare enum Weekday {
1008
1008
  * The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)
1009
1009
  * @since 1.0.0
1010
1010
  */
1011
- export declare type Importance = 1 | 2 | 3 | 4 | 5;
1011
+ export type Importance = 1 | 2 | 3 | 4 | 5;
1012
1012
  /**
1013
1013
  * The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)
1014
1014
  * @since 1.0.0
1015
1015
  */
1016
- export declare type Visibility = -1 | 0 | 1;
1016
+ export type Visibility = -1 | 0 | 1;
1017
1017
  /**
1018
1018
  * @deprecated Use 'Channel`.
1019
1019
  * @since 1.0.0
1020
1020
  */
1021
- export declare type NotificationChannel = Channel;
1021
+ export type NotificationChannel = Channel;
1022
1022
  /**
1023
1023
  * @deprecated Use `LocalNotificationDescriptor`.
1024
1024
  * @since 1.0.0
1025
1025
  */
1026
- export declare type LocalNotificationRequest = LocalNotificationDescriptor;
1026
+ export type LocalNotificationRequest = LocalNotificationDescriptor;
1027
1027
  /**
1028
1028
  * @deprecated Use `ScheduleResult`.
1029
1029
  * @since 1.0.0
1030
1030
  */
1031
- export declare type LocalNotificationScheduleResult = ScheduleResult;
1031
+ export type LocalNotificationScheduleResult = ScheduleResult;
1032
1032
  /**
1033
1033
  * @deprecated Use `PendingResult`.
1034
1034
  * @since 1.0.0
1035
1035
  */
1036
- export declare type LocalNotificationPendingList = PendingResult;
1036
+ export type LocalNotificationPendingList = PendingResult;
1037
1037
  /**
1038
1038
  * @deprecated Use `ActionType`.
1039
1039
  * @since 1.0.0
1040
1040
  */
1041
- export declare type LocalNotificationActionType = ActionType;
1041
+ export type LocalNotificationActionType = ActionType;
1042
1042
  /**
1043
1043
  * @deprecated Use `Action`.
1044
1044
  * @since 1.0.0
1045
1045
  */
1046
- export declare type LocalNotificationAction = Action;
1046
+ export type LocalNotificationAction = Action;
1047
1047
  /**
1048
1048
  * @deprecated Use `EnabledResult`.
1049
1049
  * @since 1.0.0
1050
1050
  */
1051
- export declare type LocalNotificationEnabledResult = EnabledResult;
1051
+ export type LocalNotificationEnabledResult = EnabledResult;
1052
1052
  /**
1053
1053
  * @deprecated Use `ListChannelsResult`.
1054
1054
  * @since 1.0.0
1055
1055
  */
1056
- export declare type NotificationChannelList = ListChannelsResult;
1056
+ export type NotificationChannelList = ListChannelsResult;
1057
1057
  /**
1058
1058
  * @deprecated Use `Attachment`.
1059
1059
  * @since 1.0.0
1060
1060
  */
1061
- export declare type LocalNotificationAttachment = Attachment;
1061
+ export type LocalNotificationAttachment = Attachment;
1062
1062
  /**
1063
1063
  * @deprecated Use `AttachmentOptions`.
1064
1064
  * @since 1.0.0
1065
1065
  */
1066
- export declare type LocalNotificationAttachmentOptions = AttachmentOptions;
1066
+ export type LocalNotificationAttachmentOptions = AttachmentOptions;
1067
1067
  /**
1068
1068
  * @deprecated Use `LocalNotificationSchema`.
1069
1069
  * @since 1.0.0
1070
1070
  */
1071
- export declare type LocalNotification = LocalNotificationSchema;
1071
+ export type LocalNotification = LocalNotificationSchema;
1072
1072
  /**
1073
1073
  * @deprecated Use `Schedule`.
1074
1074
  * @since 1.0.0
1075
1075
  */
1076
- export declare type LocalNotificationSchedule = Schedule;
1076
+ export type LocalNotificationSchedule = Schedule;
1077
1077
  /**
1078
1078
  * @deprecated Use `ActionPerformed`.
1079
1079
  * @since 1.0.0
1080
1080
  */
1081
- export declare type LocalNotificationActionPerformed = ActionPerformed;
1081
+ export type LocalNotificationActionPerformed = ActionPerformed;
package/dist/esm/web.js CHANGED
@@ -15,7 +15,7 @@ export class LocalNotificationsWeb extends WebPlugin {
15
15
  new Notification('');
16
16
  }
17
17
  catch (e) {
18
- if (e.name == 'TypeError') {
18
+ if (e instanceof Error && e.name === 'TypeError') {
19
19
  return false;
20
20
  }
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAgB5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAApD;;QACY,YAAO,GAA8B,EAAE,CAAC;QACxC,2BAAsB,GAAmB,EAAE,CAAC;QA2G5C,2BAAsB,GAAG,GAAY,EAAE;YAC/C,IAAI,CAAC,CAAC,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE;gBAClE,OAAO,KAAK,CAAC;aACd;YAED,IAAI,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE;gBACzC,2EAA2E;gBAC3E,iEAAiE;gBACjE,IAAI;oBACF,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;iBACtB;gBAAC,OAAO,CAAC,EAAE;oBACV,IAAI,CAAC,CAAC,IAAI,IAAI,WAAW,EAAE;wBACzB,OAAO,KAAK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AiB,CAAC,gBAAgB,CAChC,OAAO,EACP,GAAG,EAAE;YACH,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAChF,CAAC,EACD,KAAK,CACN,CAAC;QACF,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACpD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAES,OAAO,CAAC,YAAqC;QACrD,MAAM,IAAI,GAAG;YACX,QAAQ,EAAE,KAAK;YACf,YAAY;SACb,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IAES,MAAM,CAAC,YAAqC;QACpD,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PermissionState } from '@capacitor/core';\n\nimport type {\n DeliveredNotifications,\n EnabledResult,\n ListChannelsResult,\n LocalNotificationSchema,\n LocalNotificationsPlugin,\n PendingResult,\n PermissionStatus,\n ScheduleOptions,\n ScheduleResult,\n SettingsPermissionStatus,\n} from './definitions';\n\nexport class LocalNotificationsWeb extends WebPlugin implements LocalNotificationsPlugin {\n protected pending: LocalNotificationSchema[] = [];\n protected deliveredNotifications: Notification[] = [];\n\n async getDeliveredNotifications(): Promise<DeliveredNotifications> {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema: LocalNotificationSchema = {\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: DeliveredNotifications): Promise<void> {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find((n) => n.tag === String(toRemove.id));\n found?.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications(): Promise<void> {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async deleteChannel(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async listChannels(): Promise<ListChannelsResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async schedule(options: ScheduleOptions): Promise<ScheduleResult> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n\n return {\n notifications: options.notifications.map((notification) => ({\n id: notification.id,\n })),\n };\n }\n\n async getPending(): Promise<PendingResult> {\n return {\n notifications: this.pending,\n };\n }\n\n async registerActionTypes(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async cancel(pending: ScheduleResult): Promise<void> {\n this.pending = this.pending.filter((notification) => !pending.notifications.find((n) => n.id === notification.id));\n }\n\n async areEnabled(): Promise<EnabledResult> {\n const { display } = await this.checkPermissions();\n\n return {\n value: display === 'granted',\n };\n }\n\n async changeExactNotificationSetting(): Promise<SettingsPermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkExactNotificationSetting(): Promise<SettingsPermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n\n return { display };\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n const display = this.transformNotificationPermission(Notification.permission);\n\n return { display };\n }\n\n protected hasNotificationSupport = (): boolean => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\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 } catch (e) {\n if (e.name == 'TypeError') {\n return false;\n }\n }\n }\n\n return true;\n };\n\n protected transformNotificationPermission(permission: NotificationPermission): PermissionState {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n\n protected sendPending(): void {\n const toRemove: LocalNotificationSchema[] = [];\n const now = new Date().getTime();\n\n for (const notification of this.pending) {\n if (notification.schedule?.at && notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n\n this.pending = this.pending.filter((notification) => !toRemove.find((n) => n === notification));\n }\n\n protected sendNotification(notification: LocalNotificationSchema): void {\n if (notification.schedule?.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n\n protected buildNotification(notification: LocalNotificationSchema): 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(\n 'close',\n () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n },\n false,\n );\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n\n protected onClick(notification: LocalNotificationSchema): void {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n\n protected onShow(notification: LocalNotificationSchema): void {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAgB5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAApD;;QACY,YAAO,GAA8B,EAAE,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cesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PermissionState } from '@capacitor/core';\n\nimport type {\n DeliveredNotifications,\n EnabledResult,\n ListChannelsResult,\n LocalNotificationSchema,\n LocalNotificationsPlugin,\n PendingResult,\n PermissionStatus,\n ScheduleOptions,\n ScheduleResult,\n SettingsPermissionStatus,\n} from './definitions';\n\nexport class LocalNotificationsWeb extends WebPlugin implements LocalNotificationsPlugin {\n protected pending: LocalNotificationSchema[] = [];\n protected deliveredNotifications: Notification[] = [];\n\n async getDeliveredNotifications(): Promise<DeliveredNotifications> {\n const deliveredSchemas = [];\n for (const notification of this.deliveredNotifications) {\n const deliveredSchema: LocalNotificationSchema = {\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: DeliveredNotifications): Promise<void> {\n for (const toRemove of delivered.notifications) {\n const found = this.deliveredNotifications.find((n) => n.tag === String(toRemove.id));\n found?.close();\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);\n }\n }\n async removeAllDeliveredNotifications(): Promise<void> {\n for (const notification of this.deliveredNotifications) {\n notification.close();\n }\n this.deliveredNotifications = [];\n }\n async createChannel(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async deleteChannel(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async listChannels(): Promise<ListChannelsResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async schedule(options: ScheduleOptions): Promise<ScheduleResult> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n for (const notification of options.notifications) {\n this.sendNotification(notification);\n }\n\n return {\n notifications: options.notifications.map((notification) => ({\n id: notification.id,\n })),\n };\n }\n\n async getPending(): Promise<PendingResult> {\n return {\n notifications: this.pending,\n };\n }\n\n async registerActionTypes(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async cancel(pending: ScheduleResult): Promise<void> {\n this.pending = this.pending.filter((notification) => !pending.notifications.find((n) => n.id === notification.id));\n }\n\n async areEnabled(): Promise<EnabledResult> {\n const { display } = await this.checkPermissions();\n\n return {\n value: display === 'granted',\n };\n }\n\n async changeExactNotificationSetting(): Promise<SettingsPermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkExactNotificationSetting(): Promise<SettingsPermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n const display = this.transformNotificationPermission(await Notification.requestPermission());\n\n return { display };\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n if (!this.hasNotificationSupport()) {\n throw this.unavailable('Notifications not supported in this browser.');\n }\n\n const display = this.transformNotificationPermission(Notification.permission);\n\n return { display };\n }\n\n protected hasNotificationSupport = (): boolean => {\n if (!('Notification' in window) || !Notification.requestPermission) {\n return false;\n }\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 } catch (e) {\n if (e instanceof Error && e.name === 'TypeError') {\n return false;\n }\n }\n }\n\n return true;\n };\n\n protected transformNotificationPermission(permission: NotificationPermission): PermissionState {\n switch (permission) {\n case 'granted':\n return 'granted';\n case 'denied':\n return 'denied';\n default:\n return 'prompt';\n }\n }\n\n protected sendPending(): void {\n const toRemove: LocalNotificationSchema[] = [];\n const now = new Date().getTime();\n\n for (const notification of this.pending) {\n if (notification.schedule?.at && notification.schedule.at.getTime() <= now) {\n this.buildNotification(notification);\n toRemove.push(notification);\n }\n }\n\n this.pending = this.pending.filter((notification) => !toRemove.find((n) => n === notification));\n }\n\n protected sendNotification(notification: LocalNotificationSchema): void {\n if (notification.schedule?.at) {\n const diff = notification.schedule.at.getTime() - new Date().getTime();\n\n this.pending.push(notification);\n setTimeout(() => {\n this.sendPending();\n }, diff);\n return;\n }\n this.buildNotification(notification);\n }\n\n protected buildNotification(notification: LocalNotificationSchema): 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(\n 'close',\n () => {\n this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);\n },\n false,\n );\n this.deliveredNotifications.push(localNotification);\n return localNotification;\n }\n\n protected onClick(notification: LocalNotificationSchema): void {\n const data = {\n actionId: 'tap',\n notification,\n };\n this.notifyListeners('localNotificationActionPerformed', data);\n }\n\n protected onShow(notification: LocalNotificationSchema): void {\n this.notifyListeners('localNotificationReceived', notification);\n }\n}\n"]}
@@ -37,7 +37,7 @@ class LocalNotificationsWeb extends core.WebPlugin {
37
37
  new Notification('');
38
38
  }
39
39
  catch (e) {
40
- if (e.name == 'TypeError') {
40
+ if (e instanceof Error && e.name === 'TypeError') {
41
41
  return false;
42
42
  }
43
43
  }
@@ -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) && 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//# sourceMapp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AAiB;AAChC,IAAI;AACJ,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,IAAI;AACJ,IAAI,MAAM,CAAC,YAAY,EAAE;AACzB,QAAQ,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC;AACvE,IAAI;AACJ;;;;;;;;;"}
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 instanceof Error && 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) && 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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,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC;AACvE,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -36,7 +36,7 @@ var capacitorLocalNotifications = (function (exports, core) {
36
36
  new Notification('');
37
37
  }
38
38
  catch (e) {
39
- if (e.name == 'TypeError') {
39
+ if (e instanceof Error && e.name === 'TypeError') {
40
40
  return false;
41
41
  }
42
42
  }
@@ -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) && 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,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IAC/C,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,CA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itions.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 instanceof Error && 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) && 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,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IAC/C,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;IACnD,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACjD,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACjD,CAAC,EAAEA,eAAO,KA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CAAC;IACV,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IACjG,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAC/F,QAAQ,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAC1D,YAAY,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACzF,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,QAAQ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC;IAC3D,QAAQ,OAAO,iBAAiB;IAChC,IAAI;IACJ,IAAI,OAAO,CAAC,YAAY,EAAE;IAC1B,QAAQ,MAAM,IAAI,GAAG;IACrB,YAAY,QAAQ,EAAE,KAAK;IAC3B,YAAY,YAAY;IACxB,SAAS;IACT,QAAQ,IAAI,CAAC,eAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC;IACtE,IAAI;IACJ,IAAI,MAAM,CAAC,YAAY,EAAE;IACzB,QAAQ,IAAI,CAAC,eAAe,CAAC,2BAA2B,EAAE,YAAY,CAAC;IACvE,IAAI;IACJ;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/local-notifications",
3
- "version": "8.0.0-dev-2434-20251114T165054.0",
3
+ "version": "8.0.0-dev-2440-20251114T165306.0",
4
4
  "description": "The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -50,18 +50,18 @@
50
50
  "@capacitor/android": "next",
51
51
  "@capacitor/cli": "next",
52
52
  "@capacitor/core": "next",
53
- "@capacitor/docgen": "0.2.2",
53
+ "@capacitor/docgen": "0.3.0",
54
54
  "@capacitor/ios": "next",
55
55
  "@ionic/eslint-config": "^0.4.0",
56
56
  "@ionic/prettier-config": "^4.0.0",
57
- "@ionic/swiftlint-config": "^1.1.2",
58
- "eslint": "^8.57.0",
57
+ "@ionic/swiftlint-config": "^2.0.0",
58
+ "eslint": "^8.57.1",
59
59
  "prettier": "^3.6.2",
60
60
  "prettier-plugin-java": "^2.7.7",
61
- "rimraf": "^6.0.1",
62
- "rollup": "^4.26.0",
63
- "swiftlint": "^1.0.1",
64
- "typescript": "~4.1.5"
61
+ "rimraf": "^6.1.0",
62
+ "rollup": "^4.53.2",
63
+ "swiftlint": "^2.0.0",
64
+ "typescript": "^5.9.3"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@capacitor/core": "next"