diff --git a/README.md b/README.md
index 788938408..12dcbd0f9 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,6 @@ This repository contains the official Capacitor plugins maintained by the Capaci
| [`@capacitor/clipboard`](https://capacitorjs.com/docs/apis/clipboard) | [`./clipboard`](./clipboard) | [](https://www.npmjs.com/package/@capacitor/clipboard)
| [`@capacitor/device`](https://capacitorjs.com/docs/apis/device) | [`./device`](./device) | [](https://www.npmjs.com/package/@capacitor/device)
| [`@capacitor/dialog`](https://capacitorjs.com/docs/apis/dialog) | [`./dialog`](./dialog) | [](https://www.npmjs.com/package/@capacitor/dialog)
-| [`@capacitor/local-notifications`](https://capacitorjs.com/docs/apis/local-notifications) | [`./local-notifications`](./local-notifications) | [](https://www.npmjs.com/package/@capacitor/local-notifications)
| [`@capacitor/motion`](https://capacitorjs.com/docs/apis/motion) | [`./motion`](./motion) | [](https://www.npmjs.com/package/@capacitor/motion)
| [`@capacitor/network`](https://capacitorjs.com/docs/apis/network) | [`./network`](./network) | [](https://www.npmjs.com/package/@capacitor/network)
| [`@capacitor/preferences`](https://capacitorjs.com/docs/apis/preferences) | [`./preferences`](./preferences) | [](https://www.npmjs.com/package/@capacitor/preferences)
@@ -52,6 +51,7 @@ These are official Capacitor plugins that are not contained in this repository.
| [Google Maps](https://github.com/ionic-team/capacitor-google-maps) | [`@capacitor/google-maps`](https://capacitorjs.com/docs/apis/google-maps) | [](https://www.npmjs.com/package/@capacitor/google-maps) |
| [Haptics](https://github.com/ionic-team/capacitor-haptics) (*) | [`@capacitor/haptics`](https://capacitorjs.com/docs/apis/haptics) | [](https://www.npmjs.com/package/@capacitor/haptics) |
| [Keyboard](https://github.com/ionic-team/capacitor-keyboard) (*) | [`@capacitor/keyboard`](https://capacitorjs.com/docs/apis/keyboard) | [](https://www.npmjs.com/package/@capacitor/keyboard) |
+| [Local Notifications](https://github.com/ionic-team/capacitor-local-notifications) (*) | [`@capacitor/local-notifications`](https://capacitorjs.com/docs/apis/local-notifications) | [](https://www.npmjs.com/package/@capacitor/local-notifications) |
(*) These plugins were once part of this repository, but have been since been revamped and/or migrated to a separate repository. The code pre-migration [still remains in this repository](https://github.com/ionic-team/capacitor-plugins/tree/7.x) for historic purposes.
diff --git a/local-notifications/.eslintignore b/local-notifications/.eslintignore
deleted file mode 100644
index 9d0b71a3c..000000000
--- a/local-notifications/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build
-dist
diff --git a/local-notifications/.gitignore b/local-notifications/.gitignore
deleted file mode 100644
index 681763795..000000000
--- a/local-notifications/.gitignore
+++ /dev/null
@@ -1,69 +0,0 @@
-# node files
-dist
-node_modules
-
-# iOS files
-Pods
-Podfile.lock
-Package.resolved
-Build
-xcuserdata
-/.build
-/Packages
-xcuserdata/
-DerivedData/
-.swiftpm/configuration/registries.json
-.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
-.netrc
-
-# macOS files
-.DS_Store
-
-
-
-# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
-
-# Built application files
-*.apk
-*.ap_
-
-# Files for the ART/Dalvik VM
-*.dex
-
-# Java class files
-*.class
-
-# Generated files
-bin
-gen
-out
-
-# Gradle files
-.gradle
-build
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard
-
-# Log Files
-*.log
-
-# Android Studio Navigation editor temp files
-.navigation
-
-# Android Studio captures folder
-captures
-
-# IntelliJ
-*.iml
-.idea
-
-# Keystore files
-# Uncomment the following line if you do not want to check your keystore files in.
-#*.jks
-
-# External native build folder generated in Android Studio 2.2 and later
-.externalNativeBuild
diff --git a/local-notifications/CHANGELOG.md b/local-notifications/CHANGELOG.md
deleted file mode 100644
index e4cb4c16a..000000000
--- a/local-notifications/CHANGELOG.md
+++ /dev/null
@@ -1,410 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-# [9.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@9.0.0-alpha.1...@capacitor/local-notifications@9.0.0-alpha.2) (2026-07-15)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [9.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.2.0...@capacitor/local-notifications@9.0.0-alpha.1) (2026-06-19)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [8.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.1.0...@capacitor/local-notifications@8.2.0) (2026-05-15)
-
-### Features
-
-- **local-notifications:** add presentationOptions config support for iOS ([#2530](https://github.com/ionic-team/capacitor-plugins/issues/2530)) ([78bea4c](https://github.com/ionic-team/capacitor-plugins/commit/78bea4c325bcaa8b3cd2eacb8c0444b154ea6735))
-
-# [8.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.2...@capacitor/local-notifications@8.1.0) (2026-05-07)
-
-### Bug Fixes
-
-- add Importance 0 for notification channels ([#2507](https://github.com/ionic-team/capacitor-plugins/issues/2507)) ([b98c4f9](https://github.com/ionic-team/capacitor-plugins/commit/b98c4f9ee368b66dc92fb54865129df777bf38e5))
-
-### Features
-
-- **local-notifications:** deprecate summaryArgument and add relevanceScore and interruptionLevel ([#2521](https://github.com/ionic-team/capacitor-plugins/issues/2521)) ([fcff6f1](https://github.com/ionic-team/capacitor-plugins/commit/fcff6f11dc8dcbe42c0738e89b4c15239629ab24))
-
-## [8.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.1...@capacitor/local-notifications@8.0.2) (2026-03-06)
-
-### Bug Fixes
-
-- **android:** notification Bundles with non-string values ([#2445](https://github.com/ionic-team/capacitor-plugins/issues/2445)) ([2788f81](https://github.com/ionic-team/capacitor-plugins/commit/2788f81d5dfe53e5d72b32e3b724e0f1a41e8373))
-
-## [8.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.0...@capacitor/local-notifications@8.0.1) (2026-02-12)
-
-### Bug Fixes
-
-- AGP 9.0 no longer supporting `proguard-android.txt` ([#2468](https://github.com/ionic-team/capacitor-plugins/issues/2468)) ([a8760a9](https://github.com/ionic-team/capacitor-plugins/commit/a8760a989f594bc406d0ec7da58125d17447cae4))
-
-# [8.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.0-beta.0...@capacitor/local-notifications@8.0.0) (2025-12-08)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [8.0.0-beta.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@8.0.0-alpha.1...@capacitor/local-notifications@8.0.0-beta.0) (2025-11-14)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [8.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.3...@capacitor/local-notifications@8.0.0-alpha.1) (2025-09-08)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [7.0.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.2...@capacitor/local-notifications@7.0.3) (2025-09-05)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [7.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.1...@capacitor/local-notifications@7.0.2) (2025-08-05)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [7.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.0...@capacitor/local-notifications@7.0.1) (2025-04-02)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [7.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.0-rc.0...@capacitor/local-notifications@7.0.0) (2025-01-20)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [7.0.0-rc.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.0-alpha.2...@capacitor/local-notifications@7.0.0-rc.0) (2025-01-13)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.0-alpha.1...@capacitor/local-notifications@7.0.0-alpha.2) (2024-12-19)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.1.0...@capacitor/local-notifications@7.0.0-alpha.1) (2024-12-16)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0...@capacitor/local-notifications@6.1.0) (2024-08-08)
-
-### Features
-
-- **local-notifications:** Allowing local notifications to be delivered silently while app is in foreground (iOS only) ([#1921](https://github.com/ionic-team/capacitor-plugins/issues/1921)) ([9421137](https://github.com/ionic-team/capacitor-plugins/commit/94211377433c7d26208aedbcee8bb82f3d0985ae))
-
-# [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-rc.1...@capacitor/local-notifications@6.0.0) (2024-04-15)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.0.0-rc.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-rc.0...@capacitor/local-notifications@6.0.0-rc.1) (2024-03-25)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.0.0-rc.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-beta.1...@capacitor/local-notifications@6.0.0-rc.0) (2024-02-07)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.0.0-beta.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-beta.0...@capacitor/local-notifications@6.0.0-beta.1) (2023-12-14)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.0.0-beta.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-alpha.2...@capacitor/local-notifications@6.0.0-beta.0) (2023-12-13)
-
-### Features
-
-- **local-notifications:** Adding permissions for using SCHEDULE_EXACT_ALARM in Android 14 ([#1840](https://github.com/ionic-team/capacitor-plugins/issues/1840)) ([55c31e8](https://github.com/ionic-team/capacitor-plugins/commit/55c31e897783a372527121b7b74e3bf138295a15))
-
-# [6.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-alpha.1...@capacitor/local-notifications@6.0.0-alpha.2) (2023-11-15)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [6.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.6...@capacitor/local-notifications@6.0.0-alpha.1) (2023-11-08)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [5.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.5...@capacitor/local-notifications@5.0.6) (2023-07-12)
-
-### Bug Fixes
-
-- **local-notifications:** make requestPermissions resolve if granted ([#1678](https://github.com/ionic-team/capacitor-plugins/issues/1678)) ([4872589](https://github.com/ionic-team/capacitor-plugins/commit/487258940e0d1c27deeaa6326760095fc2549715))
-
-## [5.0.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.4...@capacitor/local-notifications@5.0.5) (2023-06-29)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [5.0.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.3...@capacitor/local-notifications@5.0.4) (2023-06-08)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [5.0.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.2...@capacitor/local-notifications@5.0.3) (2023-06-08)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [5.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.1...@capacitor/local-notifications@5.0.2) (2023-05-09)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [5.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.0...@capacitor/local-notifications@5.0.1) (2023-05-05)
-
-### Bug Fixes
-
-- Use Capacitor 5 final ([#1574](https://github.com/ionic-team/capacitor-plugins/issues/1574)) ([139c18b](https://github.com/ionic-team/capacitor-plugins/commit/139c18b86a11d31246e952d1a74335ff8ce5dbc2))
-
-# [5.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.0-beta.1...@capacitor/local-notifications@5.0.0) (2023-05-03)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [5.0.0-beta.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.0-beta.0...@capacitor/local-notifications@5.0.0-beta.1) (2023-04-21)
-
-### Features
-
-- Update gradle to 8.0.2 and gradle plugin to 8.0.0 ([#1542](https://github.com/ionic-team/capacitor-plugins/issues/1542)) ([e7210b4](https://github.com/ionic-team/capacitor-plugins/commit/e7210b47867644f5983e37acdbf0247214ec232d))
-
-# [5.0.0-beta.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@5.0.0-alpha.1...@capacitor/local-notifications@5.0.0-beta.0) (2023-03-31)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [5.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.5...@capacitor/local-notifications@5.0.0-alpha.1) (2023-03-16)
-
-### Features
-
-- **android:** Removing enableJetifier ([d66f9cb](https://github.com/ionic-team/capacitor-plugins/commit/d66f9cbd9da7e3b1d8c64ca6a5b45156867d4a04))
-- **local-notifications:** support Android 13+ permissions ([#1189](https://github.com/ionic-team/capacitor-plugins/issues/1189)) ([ace7d73](https://github.com/ionic-team/capacitor-plugins/commit/ace7d73c57a1a8ca780d91bd1dace70eb226b21e))
-
-## [4.1.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.4...@capacitor/local-notifications@4.1.5) (2023-02-03)
-
-### Bug Fixes
-
-- **local-notifications:** Use RTC_WAKEUP if schedule.allowWhileIdle is true ([#1362](https://github.com/ionic-team/capacitor-plugins/issues/1362)) ([1cd2259](https://github.com/ionic-team/capacitor-plugins/commit/1cd2259e33694d8aeb819f1713ccbc88600211b0))
-
-## [4.1.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.3...@capacitor/local-notifications@4.1.4) (2022-12-01)
-
-### Bug Fixes
-
-- **local-notifications:** error if notification id is bigger than allowed ([#1303](https://github.com/ionic-team/capacitor-plugins/issues/1303)) ([df7e2f5](https://github.com/ionic-team/capacitor-plugins/commit/df7e2f5a35879e618f0c3d50fe1a4b3ef4380b0e))
-
-## [4.1.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.2...@capacitor/local-notifications@4.1.3) (2022-11-16)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [4.1.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.1...@capacitor/local-notifications@4.1.2) (2022-10-21)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [4.1.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@4.1.0...@capacitor/local-notifications@4.1.1) (2022-09-29)
-
-### Bug Fixes
-
-- **local-notifications:** Add FLAG_MUTABLE to schedule on notifications ([#1173](https://github.com/ionic-team/capacitor-plugins/issues/1173)) ([98a5cb1](https://github.com/ionic-team/capacitor-plugins/commit/98a5cb1c60598bd3932a47dceb1f8918241ce8cb))
-- **local-notifications:** Showing correct scheduled notification time ([#1198](https://github.com/ionic-team/capacitor-plugins/issues/1198)) ([96c5430](https://github.com/ionic-team/capacitor-plugins/commit/96c5430f9bae13b54f3897dd1bffad030bfe3a3b))
-
-# [4.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.1.0...@capacitor/local-notifications@4.1.0) (2022-09-12)
-
-### Bug Fixes
-
-- **local-notifications:** prevent crash on restoring old notifications ([#1156](https://github.com/ionic-team/capacitor-plugins/issues/1156)) ([8c65584](https://github.com/ionic-team/capacitor-plugins/commit/8c655843ebbee5ab02503d7a10dd8296aa56ab04))
-
-## [4.0.1](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0...4.0.1) (2022-07-28)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [4.0.0](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0-beta.2...4.0.0) (2022-07-27)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [4.0.0-beta.2](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0-beta.0...4.0.0-beta.2) (2022-07-08)
-
-### Features
-
-- **local-notifications:** Add delivered notification handling ([#1060](https://github.com/ionic-team/capacitor-plugins/issues/1060)) ([0a89dc9](https://github.com/ionic-team/capacitor-plugins/commit/0a89dc97407685a7f1ec97532af304115fea7a0f))
-
-# 4.0.0-beta.0 (2022-06-27)
-
-### Bug Fixes
-
-- **local-notifications:** Add FLAG_MUTABLE to pending intents for SDK 31 support ([#914](https://github.com/ionic-team/capacitor-plugins/issues/914)) ([9ad0ce6](https://github.com/ionic-team/capacitor-plugins/commit/9ad0ce6f1497f425db907908be1b125e6ed83dbc))
-- **local-notifications:** Handle case of not allowed exact notifications ([#954](https://github.com/ionic-team/capacitor-plugins/issues/954)) ([5016996](https://github.com/ionic-team/capacitor-plugins/commit/5016996b3a4e9824d8dd2bc4c71892fc5dbc7365))
-- correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
-- inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
-- Make removeAllListeners return a promise ([#895](https://github.com/ionic-team/capacitor-plugins/issues/895)) ([e5c49d6](https://github.com/ionic-team/capacitor-plugins/commit/e5c49d64445dca70286334e6a0441d8021197b13))
-- remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
-- **android:** fire localNotificationReceived event on Android ([#217](https://github.com/ionic-team/capacitor-plugins/issues/217)) ([d97682d](https://github.com/ionic-team/capacitor-plugins/commit/d97682d9f3d6f612993716c3bc35d3015c4e0c07))
-- **local-notification:** Throw unavailable if Notification API not supported ([#285](https://github.com/ionic-team/capacitor-plugins/issues/285)) ([a90a88b](https://github.com/ionic-team/capacitor-plugins/commit/a90a88b217f5fa2a257416050afb476dd84d8051))
-- **local-notifications:** Adding check for `new Notification` support ([#295](https://github.com/ionic-team/capacitor-plugins/issues/295)) ([a806f22](https://github.com/ionic-team/capacitor-plugins/commit/a806f22577209322bdc93ef7fe5490d3b0b6e42f))
-- **local-notifications:** Checking for null schedule in notification JSObject ([#258](https://github.com/ionic-team/capacitor-plugins/issues/258)) ([73cb416](https://github.com/ionic-team/capacitor-plugins/commit/73cb4168329622bb5a6625c900090a01fc5eca99))
-- **local-notifications:** don't store notifications if not scheduled ([#310](https://github.com/ionic-team/capacitor-plugins/issues/310)) ([c1445fd](https://github.com/ionic-team/capacitor-plugins/commit/c1445fddc69db27506f83b3ea56d8e90d4384346))
-- **local-notifications:** extra not being returned on notification events ([#340](https://github.com/ionic-team/capacitor-plugins/issues/340)) ([5b03a7f](https://github.com/ionic-team/capacitor-plugins/commit/5b03a7fdbfd2e8293a9fc3726185b516d7efa9a9))
-- **local-notifications:** Make getPending not return already fired notifications ([#256](https://github.com/ionic-team/capacitor-plugins/issues/256)) ([fb96f8a](https://github.com/ionic-team/capacitor-plugins/commit/fb96f8ab8c4776528e5825be6c2e19567462eef8))
-- **local-notifications:** Opt out of Capacitor date serialization ([#264](https://github.com/ionic-team/capacitor-plugins/issues/264)) ([6e447d5](https://github.com/ionic-team/capacitor-plugins/commit/6e447d54aff3cac47df540addf2a0bf05238c158))
-- **local-notifications:** requestPermissions and checkPermissions return if enabled ([#494](https://github.com/ionic-team/capacitor-plugins/issues/494)) ([555bb1f](https://github.com/ionic-team/capacitor-plugins/commit/555bb1f9bd02ccd999891a316e7ee0f8c1844e92))
-- **local-notifications:** return schedule on as object ([#603](https://github.com/ionic-team/capacitor-plugins/issues/603)) ([ca34b01](https://github.com/ionic-team/capacitor-plugins/commit/ca34b01c73f14bb0ad14e8a501210e42a0e65b04))
-- **local-notifications:** Throw errors if missing mandatory channel fields ([#577](https://github.com/ionic-team/capacitor-plugins/issues/577)) ([6bf3a4f](https://github.com/ionic-team/capacitor-plugins/commit/6bf3a4f0de8880588200ae60e73427fa6959ea20))
-- **local-notifications:** use proper rollup config ([#528](https://github.com/ionic-team/capacitor-plugins/issues/528)) ([cd17daa](https://github.com/ionic-team/capacitor-plugins/commit/cd17daa02241f50299232212ad72722d8a35ee16))
-- normalize use of integers for notification IDs ([#195](https://github.com/ionic-team/capacitor-plugins/issues/195)) ([b56e111](https://github.com/ionic-team/capacitor-plugins/commit/b56e1118227ee58d1872dbb32a18b8484290d3c7))
-- **web:** fix scheduled notifications not being sent ([#220](https://github.com/ionic-team/capacitor-plugins/issues/220)) ([c8e92d6](https://github.com/ionic-team/capacitor-plugins/commit/c8e92d6a178f8b3278b1d3a9c364eb8120d28848))
-- add es2017 lib to tsconfig ([#180](https://github.com/ionic-team/capacitor-plugins/issues/180)) ([2c3776c](https://github.com/ionic-team/capacitor-plugins/commit/2c3776c38ca025c5ee965dec10ccf1cdb6c02e2f))
-- Use the event names from Capacitor 2 ([#215](https://github.com/ionic-team/capacitor-plugins/issues/215)) ([008fe9e](https://github.com/ionic-team/capacitor-plugins/commit/008fe9e9bf6a960b0ab7b6fc4d5014f10ba13df8))
-
-### Features
-
-- set targetSDK default value to 31 ([#824](https://github.com/ionic-team/capacitor-plugins/issues/824)) ([3ee10de](https://github.com/ionic-team/capacitor-plugins/commit/3ee10de98067984c1a4e75295d001c5a895c47f4))
-- set targetSDK default value to 32 ([#970](https://github.com/ionic-team/capacitor-plugins/issues/970)) ([fa70d96](https://github.com/ionic-team/capacitor-plugins/commit/fa70d96f141af751aae53ceb5642c46b204f5958))
-- Upgrade gradle to 7.4 ([#826](https://github.com/ionic-team/capacitor-plugins/issues/826)) ([5db0906](https://github.com/ionic-team/capacitor-plugins/commit/5db0906f6264287c4f8e69dbaecf19d4d387824b))
-- Use java 11 ([#910](https://github.com/ionic-team/capacitor-plugins/issues/910)) ([5acb2a2](https://github.com/ionic-team/capacitor-plugins/commit/5acb2a288a413492b163e4e97da46a085d9e4be0))
-- **android:** implements Activity Result API changes for permissions and activity results ([#222](https://github.com/ionic-team/capacitor-plugins/issues/222)) ([f671b9f](https://github.com/ionic-team/capacitor-plugins/commit/f671b9f4b472806ef43db6dcf302d4503cf1828c))
-- **local-notifications:** add more info to pending notifications ([#211](https://github.com/ionic-team/capacitor-plugins/issues/211)) ([7c50487](https://github.com/ionic-team/capacitor-plugins/commit/7c50487d40836380a27bd4c8d3655d83e0c3a720))
-- **local-notifications:** Add weekday scheduling support for Android and iOS ([#756](https://github.com/ionic-team/capacitor-plugins/issues/756)) ([430b485](https://github.com/ionic-team/capacitor-plugins/commit/430b48592ce59ccc967dd9a081873d7dc3937e93))
-- **local-notifications:** Adding summary text to grouped notifications ([#296](https://github.com/ionic-team/capacitor-plugins/issues/296)) ([f625bd2](https://github.com/ionic-team/capacitor-plugins/commit/f625bd28bc00dbd0b51d7bdecf5e6f3077dcc7a9))
-- **local-notifications:** Fire local notifications while app is idle ([#237](https://github.com/ionic-team/capacitor-plugins/issues/237)) ([43380ef](https://github.com/ionic-team/capacitor-plugins/commit/43380efa8901adf9d669d0c1ef20038a2fd7df8e))
-- **local-notifications:** Support for Big Text and Inbox Notification Style ([#280](https://github.com/ionic-team/capacitor-plugins/issues/280)) ([dc96ef9](https://github.com/ionic-team/capacitor-plugins/commit/dc96ef923725f5b53346431d35f82d5ff13f4e17))
-- **local-notifications:** Support setting seconds in Schedule "on" ([#253](https://github.com/ionic-team/capacitor-plugins/issues/253)) ([4ec8d06](https://github.com/ionic-team/capacitor-plugins/commit/4ec8d06e0cb52403e541a05e5c3518d4c5ea754e))
-- **web:** implement ActionPerformed and Received events ([#219](https://github.com/ionic-team/capacitor-plugins/issues/219)) ([e062901](https://github.com/ionic-team/capacitor-plugins/commit/e062901fc2e55cf6b6dc1ab20258d80a0be8b2d9))
-- add commonjs output format ([#179](https://github.com/ionic-team/capacitor-plugins/issues/179)) ([8e9e098](https://github.com/ionic-team/capacitor-plugins/commit/8e9e09862064b3f6771d7facbc4008e995d9b463))
-- Local Notifications plugin ([#94](https://github.com/ionic-team/capacitor-plugins/issues/94)) ([e59ba9c](https://github.com/ionic-team/capacitor-plugins/commit/e59ba9ceea78a26ec60e521825f228baa9d74577))
-
-# [1.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.10...@capacitor/local-notifications@1.1.0) (2022-01-19)
-
-### Bug Fixes
-
-- inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
-
-### Features
-
-- **local-notifications:** Add weekday scheduling support for Android and iOS ([#756](https://github.com/ionic-team/capacitor-plugins/issues/756)) ([430b485](https://github.com/ionic-team/capacitor-plugins/commit/430b48592ce59ccc967dd9a081873d7dc3937e93))
-
-## [1.0.10](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.9...@capacitor/local-notifications@1.0.10) (2022-01-10)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [1.0.9](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.8...@capacitor/local-notifications@1.0.9) (2021-11-03)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [1.0.8](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.7...@capacitor/local-notifications@1.0.8) (2021-10-14)
-
-### Bug Fixes
-
-- remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
-
-## [1.0.7](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.6...@capacitor/local-notifications@1.0.7) (2021-10-13)
-
-### Bug Fixes
-
-- correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
-
-## [1.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.5...@capacitor/local-notifications@1.0.6) (2021-09-15)
-
-### Bug Fixes
-
-- **local-notifications:** return schedule on as object ([#603](https://github.com/ionic-team/capacitor-plugins/issues/603)) ([ca34b01](https://github.com/ionic-team/capacitor-plugins/commit/ca34b01c73f14bb0ad14e8a501210e42a0e65b04))
-
-## [1.0.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.4...@capacitor/local-notifications@1.0.5) (2021-09-01)
-
-### Bug Fixes
-
-- **local-notifications:** Throw errors if missing mandatory channel fields ([#577](https://github.com/ionic-team/capacitor-plugins/issues/577)) ([6bf3a4f](https://github.com/ionic-team/capacitor-plugins/commit/6bf3a4f0de8880588200ae60e73427fa6959ea20))
-
-## [1.0.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.3...@capacitor/local-notifications@1.0.4) (2021-08-18)
-
-### Bug Fixes
-
-- **local-notifications:** use proper rollup config ([#528](https://github.com/ionic-team/capacitor-plugins/issues/528)) ([cd17daa](https://github.com/ionic-team/capacitor-plugins/commit/cd17daa02241f50299232212ad72722d8a35ee16))
-
-## [1.0.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.2...@capacitor/local-notifications@1.0.3) (2021-07-07)
-
-### Bug Fixes
-
-- **local-notifications:** requestPermissions and checkPermissions return if enabled ([#494](https://github.com/ionic-team/capacitor-plugins/issues/494)) ([555bb1f](https://github.com/ionic-team/capacitor-plugins/commit/555bb1f9bd02ccd999891a316e7ee0f8c1844e92))
-
-## [1.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.1...@capacitor/local-notifications@1.0.2) (2021-06-23)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [1.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@1.0.0...@capacitor/local-notifications@1.0.1) (2021-06-09)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [1.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.6.4...@capacitor/local-notifications@1.0.0) (2021-05-19)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [0.6.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.6.3...@capacitor/local-notifications@0.6.4) (2021-05-11)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [0.6.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.6.2...@capacitor/local-notifications@0.6.3) (2021-05-10)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [0.6.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.6.1...@capacitor/local-notifications@0.6.2) (2021-05-07)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-## [0.6.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.6.0...@capacitor/local-notifications@0.6.1) (2021-04-29)
-
-### Bug Fixes
-
-- **local-notifications:** don't store notifications if not scheduled ([#310](https://github.com/ionic-team/capacitor-plugins/issues/310)) ([c1445fd](https://github.com/ionic-team/capacitor-plugins/commit/c1445fddc69db27506f83b3ea56d8e90d4384346))
-- **local-notifications:** extra not being returned on notification events ([#340](https://github.com/ionic-team/capacitor-plugins/issues/340)) ([5b03a7f](https://github.com/ionic-team/capacitor-plugins/commit/5b03a7fdbfd2e8293a9fc3726185b516d7efa9a9))
-
-# [0.6.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.5.1...@capacitor/local-notifications@0.6.0) (2021-03-10)
-
-### Bug Fixes
-
-- **local-notification:** Throw unavailable if Notification API not supported ([#285](https://github.com/ionic-team/capacitor-plugins/issues/285)) ([a90a88b](https://github.com/ionic-team/capacitor-plugins/commit/a90a88b217f5fa2a257416050afb476dd84d8051))
-- **local-notifications:** Adding check for `new Notification` support ([#295](https://github.com/ionic-team/capacitor-plugins/issues/295)) ([a806f22](https://github.com/ionic-team/capacitor-plugins/commit/a806f22577209322bdc93ef7fe5490d3b0b6e42f))
-
-### Features
-
-- **local-notifications:** Adding summary text to grouped notifications ([#296](https://github.com/ionic-team/capacitor-plugins/issues/296)) ([f625bd2](https://github.com/ionic-team/capacitor-plugins/commit/f625bd28bc00dbd0b51d7bdecf5e6f3077dcc7a9))
-- **local-notifications:** Support for Big Text and Inbox Notification Style ([#280](https://github.com/ionic-team/capacitor-plugins/issues/280)) ([dc96ef9](https://github.com/ionic-team/capacitor-plugins/commit/dc96ef923725f5b53346431d35f82d5ff13f4e17))
-
-## [0.5.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.5.0...@capacitor/local-notifications@0.5.1) (2021-03-02)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# [0.5.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.4.0...@capacitor/local-notifications@0.5.0) (2021-02-27)
-
-### Bug Fixes
-
-- **local-notifications:** Checking for null schedule in notification JSObject ([#258](https://github.com/ionic-team/capacitor-plugins/issues/258)) ([73cb416](https://github.com/ionic-team/capacitor-plugins/commit/73cb4168329622bb5a6625c900090a01fc5eca99))
-- **local-notifications:** Make getPending not return already fired notifications ([#256](https://github.com/ionic-team/capacitor-plugins/issues/256)) ([fb96f8a](https://github.com/ionic-team/capacitor-plugins/commit/fb96f8ab8c4776528e5825be6c2e19567462eef8))
-- **local-notifications:** Opt out of Capacitor date serialization ([#264](https://github.com/ionic-team/capacitor-plugins/issues/264)) ([6e447d5](https://github.com/ionic-team/capacitor-plugins/commit/6e447d54aff3cac47df540addf2a0bf05238c158))
-
-### Features
-
-- **local-notifications:** Support setting seconds in Schedule "on" ([#253](https://github.com/ionic-team/capacitor-plugins/issues/253)) ([4ec8d06](https://github.com/ionic-team/capacitor-plugins/commit/4ec8d06e0cb52403e541a05e5c3518d4c5ea754e))
-
-# [0.4.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.3.0...@capacitor/local-notifications@0.4.0) (2021-02-10)
-
-### Features
-
-- **android:** implements Activity Result API changes for permissions and activity results ([#222](https://github.com/ionic-team/capacitor-plugins/issues/222)) ([f671b9f](https://github.com/ionic-team/capacitor-plugins/commit/f671b9f4b472806ef43db6dcf302d4503cf1828c))
-
-# [0.3.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.2.1...@capacitor/local-notifications@0.3.0) (2021-02-05)
-
-### Bug Fixes
-
-- **android:** fire localNotificationReceived event on Android ([#217](https://github.com/ionic-team/capacitor-plugins/issues/217)) ([d97682d](https://github.com/ionic-team/capacitor-plugins/commit/d97682d9f3d6f612993716c3bc35d3015c4e0c07))
-- normalize use of integers for notification IDs ([#195](https://github.com/ionic-team/capacitor-plugins/issues/195)) ([b56e111](https://github.com/ionic-team/capacitor-plugins/commit/b56e1118227ee58d1872dbb32a18b8484290d3c7))
-- **web:** fix scheduled notifications not being sent ([#220](https://github.com/ionic-team/capacitor-plugins/issues/220)) ([c8e92d6](https://github.com/ionic-team/capacitor-plugins/commit/c8e92d6a178f8b3278b1d3a9c364eb8120d28848))
-
-### Features
-
-- **local-notifications:** add more info to pending notifications ([#211](https://github.com/ionic-team/capacitor-plugins/issues/211)) ([7c50487](https://github.com/ionic-team/capacitor-plugins/commit/7c50487d40836380a27bd4c8d3655d83e0c3a720))
-- **local-notifications:** Fire local notifications while app is idle ([#237](https://github.com/ionic-team/capacitor-plugins/issues/237)) ([43380ef](https://github.com/ionic-team/capacitor-plugins/commit/43380efa8901adf9d669d0c1ef20038a2fd7df8e))
-- **web:** implement ActionPerformed and Received events ([#219](https://github.com/ionic-team/capacitor-plugins/issues/219)) ([e062901](https://github.com/ionic-team/capacitor-plugins/commit/e062901fc2e55cf6b6dc1ab20258d80a0be8b2d9))
-
-## [0.2.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.2.0...@capacitor/local-notifications@0.2.1) (2021-01-26)
-
-### Bug Fixes
-
-- Use the event names from Capacitor 2 ([#215](https://github.com/ionic-team/capacitor-plugins/issues/215)) ([008fe9e](https://github.com/ionic-team/capacitor-plugins/commit/008fe9e9bf6a960b0ab7b6fc4d5014f10ba13df8))
-
-# [0.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@0.1.0...@capacitor/local-notifications@0.2.0) (2021-01-14)
-
-**Note:** Version bump only for package @capacitor/local-notifications
-
-# 0.1.0 (2021-01-13)
-
-### Bug Fixes
-
-- add es2017 lib to tsconfig ([#180](https://github.com/ionic-team/capacitor-plugins/issues/180)) ([2c3776c](https://github.com/ionic-team/capacitor-plugins/commit/2c3776c38ca025c5ee965dec10ccf1cdb6c02e2f))
-
-### Features
-
-- add commonjs output format ([#179](https://github.com/ionic-team/capacitor-plugins/issues/179)) ([8e9e098](https://github.com/ionic-team/capacitor-plugins/commit/8e9e09862064b3f6771d7facbc4008e995d9b463))
-- Local Notifications plugin ([#94](https://github.com/ionic-team/capacitor-plugins/issues/94)) ([e59ba9c](https://github.com/ionic-team/capacitor-plugins/commit/e59ba9ceea78a26ec60e521825f228baa9d74577))
diff --git a/local-notifications/CapacitorLocalNotifications.podspec b/local-notifications/CapacitorLocalNotifications.podspec
deleted file mode 100644
index 4e9aea13e..000000000
--- a/local-notifications/CapacitorLocalNotifications.podspec
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'json'
-
-package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
-
-Pod::Spec.new do |s|
- s.name = 'CapacitorLocalNotifications'
- s.version = package['version']
- s.summary = package['description']
- s.license = package['license']
- s.homepage = 'https://capacitorjs.com'
- s.author = package['author']
- s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
- s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'local-notifications/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
- s.ios.deployment_target = '16.0'
- s.dependency 'Capacitor'
- s.swift_version = '5.1'
-end
diff --git a/local-notifications/LICENSE b/local-notifications/LICENSE
deleted file mode 100644
index 6652495cb..000000000
--- a/local-notifications/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright 2020-present Ionic
-https://ionic.io
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/local-notifications/Package.swift b/local-notifications/Package.swift
deleted file mode 100644
index 9d694b35a..000000000
--- a/local-notifications/Package.swift
+++ /dev/null
@@ -1,27 +0,0 @@
-// swift-tools-version: 5.9
-import PackageDescription
-
-let package = Package(
- name: "CapacitorLocalNotifications",
- platforms: [.iOS(.v16)],
- products: [
- .library(
- name: "CapacitorLocalNotifications",
- targets: ["LocalNotificationsPlugin"])
- ],
- dependencies: [
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "9.0.0-alpha.5")
- ],
- targets: [
- .target(
- name: "LocalNotificationsPlugin",
- dependencies: [
- .product(name: "Capacitor", package: "capacitor-swift-pm")
- ],
- path: "ios/Sources/LocalNotificationsPlugin"),
- .testTarget(
- name: "LocalNotificationsPluginTests",
- dependencies: ["LocalNotificationsPlugin"],
- path: "ios/Tests/LocalNotificationsPluginTests")
- ]
-)
diff --git a/local-notifications/README.md b/local-notifications/README.md
deleted file mode 100644
index 73ac624f6..000000000
--- a/local-notifications/README.md
+++ /dev/null
@@ -1,792 +0,0 @@
-# @capacitor/local-notifications
-
-The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).
-
-## Install
-
-```bash
-npm install @capacitor/local-notifications
-npx cap sync
-```
-
-## Android
-
-Android 13 requires a permission check in order to send notifications. You are required to call `checkPermissions()` and `requestPermissions()` accordingly.
-
-On Android 12 and older it won't show a prompt and will just return as granted.
-
-Starting on Android 12, scheduled notifications won't be exact unless this permission is added to your `AndroidManifest.xml`:
-
-```xml
-
-```
-
-Note that even if the permission is present, users can still disable exact notifications from the app settings. Use `checkExactNotificationSetting()` to check the the value of the setting. If a user disables this setting, the app will restart and any notification scheduled with an exact alarm will be deleted. If your application depends on exact alarms, be sure to check this setting on app launch (for example, in [`App.appStateChange`](https://capacitorjs.com/docs/apis/app#addlistenerappstatechange-)) in order to provide fallbacks or alternative behavior.
-
-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).
-
-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.
-
-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.
-
-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).
-
-## Configuration
-
-
-
-
-The Local Notifications can be configured with the following options:
-
-| Prop | Type | Description | Since |
-| ------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`smallIcon`** | string | 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 |
-| **`iconColor`** | string | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 |
-| **`sound`** | string | Set the default notification sound for notifications. It sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in no sound. Only available for Android. | 1.0.0 |
-| **`presentationOptions`** | LocalNotificationPresentationOption[] | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the notification is received - `banner`: the notification is displayed as a banner - `list`: the notification is displayed in the notification center An empty array can be provided if none of the options are desired. Only available for iOS. | 8.2.0 |
-
-### Examples
-
-In `capacitor.config.json`:
-
-```json
-{
- "plugins": {
- "LocalNotifications": {
- "smallIcon": "ic_stat_icon_config_sample",
- "iconColor": "#488AFF",
- "sound": "beep.wav",
- "presentationOptions": ["badge", "sound", "banner", "list"]
- }
- }
-}
-```
-
-In `capacitor.config.ts`:
-
-```ts
-///
-
-import { CapacitorConfig } from '@capacitor/cli';
-
-const config: CapacitorConfig = {
- plugins: {
- LocalNotifications: {
- smallIcon: "ic_stat_icon_config_sample",
- iconColor: "#488AFF",
- sound: "beep.wav",
- presentationOptions: ["badge", "sound", "banner", "list"],
- },
- },
-};
-
-export default config;
-```
-
-
-
-## Doze
-
-If the device has entered [Doze](https://developer.android.com/training/monitoring-device-state/doze-standby) mode, your application may have restricted capabilities. If you need your notification to fire even during Doze, schedule your notification by using `allowWhileIdle: true`. Make use of `allowWhileIdle` judiciously, as these notifications [can only fire once per 9 minutes, per app.](https://developer.android.com/training/monitoring-device-state/doze-standby#assessing_your_app)
-
-## API
-
-
-
-* [`schedule(...)`](#schedule)
-* [`getPending()`](#getpending)
-* [`registerActionTypes(...)`](#registeractiontypes)
-* [`cancel(...)`](#cancel)
-* [`areEnabled()`](#areenabled)
-* [`getDeliveredNotifications()`](#getdeliverednotifications)
-* [`removeDeliveredNotifications(...)`](#removedeliverednotifications)
-* [`removeAllDeliveredNotifications()`](#removealldeliverednotifications)
-* [`createChannel(...)`](#createchannel)
-* [`deleteChannel(...)`](#deletechannel)
-* [`listChannels()`](#listchannels)
-* [`checkPermissions()`](#checkpermissions)
-* [`requestPermissions()`](#requestpermissions)
-* [`changeExactNotificationSetting()`](#changeexactnotificationsetting)
-* [`checkExactNotificationSetting()`](#checkexactnotificationsetting)
-* [`addListener('localNotificationReceived', ...)`](#addlistenerlocalnotificationreceived-)
-* [`addListener('localNotificationActionPerformed', ...)`](#addlistenerlocalnotificationactionperformed-)
-* [`removeAllListeners()`](#removealllisteners)
-* [Interfaces](#interfaces)
-* [Type Aliases](#type-aliases)
-* [Enums](#enums)
-
-
-
-
-
-
-### schedule(...)
-
-```typescript
-schedule(options: ScheduleOptions) => Promise
-```
-
-Schedule one or more local notifications.
-
-| Param | Type |
-| ------------- | ----------------------------------------------------------- |
-| **`options`** | ScheduleOptions |
-
-**Returns:** Promise<ScheduleResult>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### getPending()
-
-```typescript
-getPending() => Promise
-```
-
-Get a list of pending notifications.
-
-**Returns:** Promise<PendingResult>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### registerActionTypes(...)
-
-```typescript
-registerActionTypes(options: RegisterActionTypesOptions) => Promise
-```
-
-Register actions to take when notifications are displayed.
-
-Only available for iOS and Android.
-
-| Param | Type |
-| ------------- | --------------------------------------------------------------------------------- |
-| **`options`** | RegisterActionTypesOptions |
-
-**Since:** 1.0.0
-
---------------------
-
-
-### cancel(...)
-
-```typescript
-cancel(options: CancelOptions) => Promise
-```
-
-Cancel pending notifications.
-
-| Param | Type |
-| ------------- | ------------------------------------------------------- |
-| **`options`** | CancelOptions |
-
-**Since:** 1.0.0
-
---------------------
-
-
-### areEnabled()
-
-```typescript
-areEnabled() => Promise
-```
-
-Check if notifications are enabled or not.
-
-**Returns:** Promise<EnabledResult>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### getDeliveredNotifications()
-
-```typescript
-getDeliveredNotifications() => Promise
-```
-
-Get a list of notifications that are visible on the notifications screen.
-
-**Returns:** Promise<DeliveredNotifications>
-
-**Since:** 4.0.0
-
---------------------
-
-
-### removeDeliveredNotifications(...)
-
-```typescript
-removeDeliveredNotifications(delivered: DeliveredNotifications) => Promise
-```
-
-Remove the specified notifications from the notifications screen.
-
-| Param | Type |
-| --------------- | ------------------------------------------------------------------------- |
-| **`delivered`** | DeliveredNotifications |
-
-**Since:** 4.0.0
-
---------------------
-
-
-### removeAllDeliveredNotifications()
-
-```typescript
-removeAllDeliveredNotifications() => Promise
-```
-
-Remove all the notifications from the notifications screen.
-
-**Since:** 4.0.0
-
---------------------
-
-
-### createChannel(...)
-
-```typescript
-createChannel(channel: Channel) => Promise
-```
-
-Create a notification channel.
-
-Only available for Android.
-
-| Param | Type |
-| ------------- | ------------------------------------------- |
-| **`channel`** | Channel |
-
-**Since:** 1.0.0
-
---------------------
-
-
-### deleteChannel(...)
-
-```typescript
-deleteChannel(args: { id: string; }) => Promise
-```
-
-Delete a notification channel.
-
-Only available for Android.
-
-| Param | Type |
-| ---------- | ---------------------------- |
-| **`args`** | { id: string; } |
-
-**Since:** 1.0.0
-
---------------------
-
-
-### listChannels()
-
-```typescript
-listChannels() => Promise
-```
-
-Get a list of notification channels.
-
-Only available for Android.
-
-**Returns:** Promise<ListChannelsResult>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### checkPermissions()
-
-```typescript
-checkPermissions() => Promise
-```
-
-Check permission to display local notifications.
-
-**Returns:** Promise<PermissionStatus>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### requestPermissions()
-
-```typescript
-requestPermissions() => Promise
-```
-
-Request permission to display local notifications.
-
-**Returns:** Promise<PermissionStatus>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### changeExactNotificationSetting()
-
-```typescript
-changeExactNotificationSetting() => Promise
-```
-
-Direct user to the application settings screen to configure exact alarms.
-
-In the event that a user changes the settings from granted to denied, the application
-will restart and any notification scheduled with an exact alarm will be deleted.
-
-On Android < 12, the user will NOT be directed to the application settings screen, instead this function will
-return `granted`.
-
-Only available on Android.
-
-**Returns:** Promise<SettingsPermissionStatus>
-
-**Since:** 6.0.0
-
---------------------
-
-
-### checkExactNotificationSetting()
-
-```typescript
-checkExactNotificationSetting() => Promise
-```
-
-Check application setting for using exact alarms.
-
-Only available on Android.
-
-**Returns:** Promise<SettingsPermissionStatus>
-
-**Since:** 6.0.0
-
---------------------
-
-
-### addListener('localNotificationReceived', ...)
-
-```typescript
-addListener(eventName: 'localNotificationReceived', listenerFunc: (notification: LocalNotificationSchema) => void) => Promise
-```
-
-Listen for when notifications are displayed.
-
-| Param | Type |
-| ------------------ | ------------------------------------------------------------------------------------------------------ |
-| **`eventName`** | 'localNotificationReceived' |
-| **`listenerFunc`** | (notification: LocalNotificationSchema) => void |
-
-**Returns:** Promise<PluginListenerHandle>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### addListener('localNotificationActionPerformed', ...)
-
-```typescript
-addListener(eventName: 'localNotificationActionPerformed', listenerFunc: (notificationAction: ActionPerformed) => void) => Promise
-```
-
-Listen for when an action is performed on a notification.
-
-| Param | Type |
-| ------------------ | -------------------------------------------------------------------------------------------- |
-| **`eventName`** | 'localNotificationActionPerformed' |
-| **`listenerFunc`** | (notificationAction: ActionPerformed) => void |
-
-**Returns:** Promise<PluginListenerHandle>
-
-**Since:** 1.0.0
-
---------------------
-
-
-### removeAllListeners()
-
-```typescript
-removeAllListeners() => Promise
-```
-
-Remove all listeners for this plugin.
-
-**Since:** 1.0.0
-
---------------------
-
-
-### Interfaces
-
-
-#### ScheduleResult
-
-| Prop | Type | Description | Since |
-| ------------------- | ------------------------------------------ | ------------------------------------ | ----- |
-| **`notifications`** | LocalNotificationDescriptor[] | The list of scheduled notifications. | 1.0.0 |
-
-
-#### LocalNotificationDescriptor
-
-The object that describes a local notification.
-
-| Prop | Type | Description | Since |
-| -------- | ------------------- | ---------------------------- | ----- |
-| **`id`** | number | The notification identifier. | 1.0.0 |
-
-
-#### ScheduleOptions
-
-| Prop | Type | Description | Since |
-| ------------------- | -------------------------------------- | -------------------------------------- | ----- |
-| **`notifications`** | LocalNotificationSchema[] | The list of notifications to schedule. | 1.0.0 |
-
-
-#### LocalNotificationSchema
-
-| Prop | Type | Description | Since |
-| ----------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`title`** | string | The title of the notification. | 1.0.0 |
-| **`body`** | string | The body of the notification, shown below the title. | 1.0.0 |
-| **`largeBody`** | string | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
-| **`summaryText`** | string | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
-| **`id`** | number | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
-| **`schedule`** | Schedule | Schedule this notification for a later time. | 1.0.0 |
-| **`sound`** | string | Name of the audio file to play when this notification is displayed. Include the file extension with the filename. The file should be in the app bundle. Recommended format is `.wav`. Only available for iOS. For Android, use channelId of a channel configured with the desired sound. If the sound file is not found, (i.e. empty string or wrong name) the default system notification sound will be used. If not provided, it will produce no sound. | 1.0.0 |
-| **`smallIcon`** | string | 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 |
-| **`largeIcon`** | string | 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 |
-| **`iconColor`** | string | Set the color of the notification icon. Only available for Android. | 1.0.0 |
-| **`attachments`** | Attachment[] | Set attachments for this notification. | 1.0.0 |
-| **`actionTypeId`** | string | Associate an action type with this notification. | 1.0.0 |
-| **`extra`** | any | Set extra data to store within this notification. | 1.0.0 |
-| **`threadIdentifier`** | string | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
-| **`relevanceScore`** | number | The score the system uses to determine if the notification is the featured notification when the system groups the app's notifications. The value must be between 0 and 1, where 0 is the least relevant and 1 is the most relevant. The default value is 0. Sets `relevanceScore` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 8.1.0 |
-| **`interruptionLevel`** | InterruptionLevel | The interruption level that indicates the priority and delivery timing of a notification. Sets `interruptionLevel` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 8.1.0 |
-| **`group`** | string | 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 |
-| **`groupSummary`** | boolean | 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 |
-| **`channelId`** | string | Specifies the channel the notification should be delivered on. If channel with the given name does not exist then the notification will not fire. If not provided, it will use the default channel. Calls `setChannelId()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
-| **`ongoing`** | boolean | 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 |
-| **`autoCancel`** | boolean | 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 |
-| **`inboxList`** | string[] | 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 |
-| **`silent`** | boolean | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 |
-
-
-#### Schedule
-
-Represents a schedule for a notification.
-
-Use either `at`, `on`, or `every` to schedule notifications.
-
-| Prop | Type | Description | Since |
-| -------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`at`** | Date | Schedule a notification at a specific date and time. | 1.0.0 |
-| **`repeats`** | boolean | Repeat delivery of this notification at the date and time specified by `at`. Only available for iOS and Android. | 1.0.0 |
-| **`allowWhileIdle`** | boolean | 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 |
-| **`on`** | ScheduleOn | Schedule 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 |
-| **`every`** | ScheduleEvery | Schedule a notification on a particular interval. | 1.0.0 |
-| **`count`** | number | Limit the number times a notification is delivered by the interval specified by `every`. | 1.0.0 |
-
-
-#### Date
-
-Enables basic storage and retrieval of dates and times.
-
-| Method | Signature | Description |
-| ---------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
-| **toString** | () => string | Returns a string representation of a date. The format of the string depends on the locale. |
-| **toDateString** | () => string | Returns a date as a string value. |
-| **toTimeString** | () => string | Returns a time as a string value. |
-| **toLocaleString** | () => string | Returns a value as a string value appropriate to the host environment's current locale. |
-| **toLocaleDateString** | () => string | Returns a date as a string value appropriate to the host environment's current locale. |
-| **toLocaleTimeString** | () => string | Returns a time as a string value appropriate to the host environment's current locale. |
-| **valueOf** | () => number | Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. |
-| **getTime** | () => number | Gets the time value in milliseconds. |
-| **getFullYear** | () => number | Gets the year, using local time. |
-| **getUTCFullYear** | () => number | Gets the year using Universal Coordinated Time (UTC). |
-| **getMonth** | () => number | Gets the month, using local time. |
-| **getUTCMonth** | () => number | Gets the month of a Date object using Universal Coordinated Time (UTC). |
-| **getDate** | () => number | Gets the day-of-the-month, using local time. |
-| **getUTCDate** | () => number | Gets the day-of-the-month, using Universal Coordinated Time (UTC). |
-| **getDay** | () => number | Gets the day of the week, using local time. |
-| **getUTCDay** | () => number | Gets the day of the week using Universal Coordinated Time (UTC). |
-| **getHours** | () => number | Gets the hours in a date, using local time. |
-| **getUTCHours** | () => number | Gets the hours value in a Date object using Universal Coordinated Time (UTC). |
-| **getMinutes** | () => number | Gets the minutes of a Date object, using local time. |
-| **getUTCMinutes** | () => number | Gets the minutes of a Date object using Universal Coordinated Time (UTC). |
-| **getSeconds** | () => number | Gets the seconds of a Date object, using local time. |
-| **getUTCSeconds** | () => number | Gets the seconds of a Date object using Universal Coordinated Time (UTC). |
-| **getMilliseconds** | () => number | Gets the milliseconds of a Date, using local time. |
-| **getUTCMilliseconds** | () => number | Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). |
-| **getTimezoneOffset** | () => number | Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). |
-| **setTime** | (time: number) => number | Sets the date and time value in the Date object. |
-| **setMilliseconds** | (ms: number) => number | Sets the milliseconds value in the Date object using local time. |
-| **setUTCMilliseconds** | (ms: number) => number | Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). |
-| **setSeconds** | (sec: number, ms?: number \| undefined) => number | Sets the seconds value in the Date object using local time. |
-| **setUTCSeconds** | (sec: number, ms?: number \| undefined) => number | Sets the seconds value in the Date object using Universal Coordinated Time (UTC). |
-| **setMinutes** | (min: number, sec?: number \| undefined, ms?: number \| undefined) => number | Sets the minutes value in the Date object using local time. |
-| **setUTCMinutes** | (min: number, sec?: number \| undefined, ms?: number \| undefined) => number | Sets the minutes value in the Date object using Universal Coordinated Time (UTC). |
-| **setHours** | (hours: number, min?: number \| undefined, sec?: number \| undefined, ms?: number \| undefined) => number | Sets the hour value in the Date object using local time. |
-| **setUTCHours** | (hours: number, min?: number \| undefined, sec?: number \| undefined, ms?: number \| undefined) => number | Sets the hours value in the Date object using Universal Coordinated Time (UTC). |
-| **setDate** | (date: number) => number | Sets the numeric day-of-the-month value of the Date object using local time. |
-| **setUTCDate** | (date: number) => number | Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). |
-| **setMonth** | (month: number, date?: number \| undefined) => number | Sets the month value in the Date object using local time. |
-| **setUTCMonth** | (month: number, date?: number \| undefined) => number | Sets the month value in the Date object using Universal Coordinated Time (UTC). |
-| **setFullYear** | (year: number, month?: number \| undefined, date?: number \| undefined) => number | Sets the year of the Date object using local time. |
-| **setUTCFullYear** | (year: number, month?: number \| undefined, date?: number \| undefined) => number | Sets the year value in the Date object using Universal Coordinated Time (UTC). |
-| **toUTCString** | () => string | Returns a date converted to a string using Universal Coordinated Time (UTC). |
-| **toISOString** | () => string | Returns a date as a string value in ISO format. |
-| **toJSON** | (key?: any) => string | Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. |
-
-
-#### ScheduleOn
-
-| Prop | Type |
-| ------------- | ------------------------------------------- |
-| **`year`** | number |
-| **`month`** | number |
-| **`day`** | number |
-| **`weekday`** | Weekday |
-| **`hour`** | number |
-| **`minute`** | number |
-| **`second`** | number |
-
-
-#### Attachment
-
-Represents a notification attachment.
-
-| Prop | Type | Description | Since |
-| ------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`id`** | string | The attachment identifier. | 1.0.0 |
-| **`url`** | string | The URL to the attachment. Use the `res` scheme to reference web assets, e.g. `res:///assets/img/icon.png`. Also accepts `file` URLs. | 1.0.0 |
-| **`options`** | AttachmentOptions | Attachment options. | 1.0.0 |
-
-
-#### AttachmentOptions
-
-| Prop | Type | Description | Since |
-| ---------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`iosUNNotificationAttachmentOptionsTypeHintKey`** | string | Sets the `UNNotificationAttachmentOptionsTypeHintKey` key in the hashable options of [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment). Only available for iOS. | 1.0.0 |
-| **`iosUNNotificationAttachmentOptionsThumbnailHiddenKey`** | string | Sets the `UNNotificationAttachmentOptionsThumbnailHiddenKey` key in the hashable options of [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment). Only available for iOS. | 1.0.0 |
-| **`iosUNNotificationAttachmentOptionsThumbnailClippingRectKey`** | string | Sets the `UNNotificationAttachmentOptionsThumbnailClippingRectKey` key in the hashable options of [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment). Only available for iOS. | 1.0.0 |
-| **`iosUNNotificationAttachmentOptionsThumbnailTimeKey`** | string | Sets the `UNNotificationAttachmentOptionsThumbnailTimeKey` key in the hashable options of [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment). Only available for iOS. | 1.0.0 |
-
-
-#### PendingResult
-
-| Prop | Type | Description | Since |
-| ------------------- | --------------------------------------------- | ---------------------------------- | ----- |
-| **`notifications`** | PendingLocalNotificationSchema[] | The list of pending notifications. | 1.0.0 |
-
-
-#### PendingLocalNotificationSchema
-
-| Prop | Type | Description | Since |
-| -------------- | --------------------------------------------- | -------------------------------------------------------------------- | ----- |
-| **`title`** | string | The title of the notification. | 1.0.0 |
-| **`body`** | string | The body of the notification, shown below the title. | 1.0.0 |
-| **`id`** | number | The notification identifier. | 1.0.0 |
-| **`schedule`** | Schedule | Schedule this notification for a later time. | 1.0.0 |
-| **`extra`** | any | Set extra data to store within this notification. | 1.0.0 |
-
-
-#### RegisterActionTypesOptions
-
-| Prop | Type | Description | Since |
-| ----------- | ------------------------- | ------------------------------------- | ----- |
-| **`types`** | ActionType[] | The list of action types to register. | 1.0.0 |
-
-
-#### ActionType
-
-A collection of actions.
-
-| Prop | Type | Description | Since |
-| -------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`id`** | string | The ID of the action type. Referenced in notifications by the `actionTypeId` key. | 1.0.0 |
-| **`actions`** | Action[] | The list of actions associated with this action type. | 1.0.0 |
-| **`iosHiddenPreviewsBodyPlaceholder`** | string | Sets `hiddenPreviewsBodyPlaceholder` of the [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory). Only available for iOS. | 1.0.0 |
-| **`iosCustomDismissAction`** | boolean | Sets `customDismissAction` in the options of the [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory). Only available for iOS. | 1.0.0 |
-| **`iosAllowInCarPlay`** | boolean | Sets `allowInCarPlay` in the options of the [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory). Only available for iOS. | 1.0.0 |
-| **`iosHiddenPreviewsShowTitle`** | boolean | Sets `hiddenPreviewsShowTitle` in the options of the [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory). Only available for iOS. | 1.0.0 |
-| **`iosHiddenPreviewsShowSubtitle`** | boolean | Sets `hiddenPreviewsShowSubtitle` in the options of the [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory). Only available for iOS. | 1.0.0 |
-
-
-#### Action
-
-An action that can be taken when a notification is displayed.
-
-| Prop | Type | Description | Since |
-| ---------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`id`** | string | The action identifier. Referenced in the `'actionPerformed'` event as `actionId`. | 1.0.0 |
-| **`title`** | string | The title text to display for this action. | 1.0.0 |
-| **`requiresAuthentication`** | boolean | Sets `authenticationRequired` in the options of the [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction). Only available for iOS. | 1.0.0 |
-| **`foreground`** | boolean | Sets `foreground` in the options of the [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction). Only available for iOS. | 1.0.0 |
-| **`destructive`** | boolean | Sets `destructive` in the options of the [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction). Only available for iOS. | 1.0.0 |
-| **`input`** | boolean | Use a `UNTextInputNotificationAction` instead of a `UNNotificationAction`. Only available for iOS. | 1.0.0 |
-| **`inputButtonTitle`** | string | Sets `textInputButtonTitle` on the [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction). Only available for iOS when `input` is `true`. | 1.0.0 |
-| **`inputPlaceholder`** | string | Sets `textInputPlaceholder` on the [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction). Only available for iOS when `input` is `true`. | 1.0.0 |
-
-
-#### CancelOptions
-
-| Prop | Type | Description | Since |
-| ------------------- | ------------------------------------------ | ------------------------------------ | ----- |
-| **`notifications`** | LocalNotificationDescriptor[] | The list of notifications to cancel. | 1.0.0 |
-
-
-#### EnabledResult
-
-| Prop | Type | Description | Since |
-| ----------- | -------------------- | ---------------------------------------------------------- | ----- |
-| **`value`** | boolean | Whether or not the device has local notifications enabled. | 1.0.0 |
-
-
-#### DeliveredNotifications
-
-| Prop | Type | Description | Since |
-| ------------------- | ------------------------------------------ | ------------------------------------------------------------------- | ----- |
-| **`notifications`** | DeliveredNotificationSchema[] | List of notifications that are visible on the notifications screen. | 1.0.0 |
-
-
-#### DeliveredNotificationSchema
-
-| Prop | Type | Description | Since |
-| ------------------ | --------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----- |
-| **`id`** | number | The notification identifier. | 4.0.0 |
-| **`tag`** | string | The notification tag. Only available on Android. | 4.0.0 |
-| **`title`** | string | The title of the notification. | 4.0.0 |
-| **`body`** | string | The body of the notification, shown below the title. | 4.0.0 |
-| **`group`** | string | The configured group of the notification. Only available for Android. | 4.0.0 |
-| **`groupSummary`** | boolean | If this notification is the summary for a group of notifications. Only available for Android. | 4.0.0 |
-| **`data`** | any | Any additional data that was included in the notification payload. Only available for Android. | 4.0.0 |
-| **`extra`** | any | Extra data to store within this notification. Only available for iOS. | 4.0.0 |
-| **`attachments`** | Attachment[] | The attachments for this notification. Only available for iOS. | 1.0.0 |
-| **`actionTypeId`** | string | Action type ssociated with this notification. Only available for iOS. | 4.0.0 |
-| **`schedule`** | Schedule | Schedule used to fire this notification. Only available for iOS. | 4.0.0 |
-| **`sound`** | string | Sound that was used when the notification was displayed. Only available for iOS. | 4.0.0 |
-
-
-#### Channel
-
-| Prop | Type | Description | Default | Since |
-| ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----- |
-| **`id`** | string | The channel identifier. | | 1.0.0 |
-| **`name`** | string | The human-friendly name of this channel (presented to the user). | | 1.0.0 |
-| **`description`** | string | The description of this channel (presented to the user). | | 1.0.0 |
-| **`sound`** | string | The sound that should be played for notifications posted to this channel. Notification channels with an importance of at least `3` should have a sound. The file name of a sound file should be specified relative to the android app `res/raw` directory. If the sound is not provided, or the sound file is not found no sound will be used. | | 1.0.0 |
-| **`importance`** | Importance | The level of interruption for notifications posted to this channel. | `3` | 1.0.0 |
-| **`visibility`** | Visibility | The visibility of notifications posted to this channel. This setting is for whether notifications posted to this channel appear on the lockscreen or not, and if so, whether they appear in a redacted form. | | 1.0.0 |
-| **`lights`** | boolean | Whether notifications posted to this channel should display notification lights, on devices that support it. | | 1.0.0 |
-| **`lightColor`** | string | The light color for notifications posted to this channel. Only supported if lights are enabled on this channel and the device supports it. Supported color formats are `#RRGGBB` and `#RRGGBBAA`. | | 1.0.0 |
-| **`vibration`** | boolean | Whether notifications posted to this channel should vibrate. | | 1.0.0 |
-
-
-#### ListChannelsResult
-
-| Prop | Type | Description | Since |
-| -------------- | ---------------------- | ---------------------------------- | ----- |
-| **`channels`** | Channel[] | The list of notification channels. | 1.0.0 |
-
-
-#### PermissionStatus
-
-| Prop | Type | Description | Since |
-| ------------- | ----------------------------------------------------------- | --------------------------------------------- | ----- |
-| **`display`** | PermissionState | Permission state of displaying notifications. | 1.0.0 |
-
-
-#### SettingsPermissionStatus
-
-| Prop | Type | Description | Since |
-| ----------------- | ----------------------------------------------------------- | --------------------------------------- | ----- |
-| **`exact_alarm`** | PermissionState | Permission state of using exact alarms. | 6.0.0 |
-
-
-#### PluginListenerHandle
-
-| Prop | Type |
-| ------------ | ----------------------------------------- |
-| **`remove`** | () => Promise<void> |
-
-
-#### ActionPerformed
-
-| Prop | Type | Description | Since |
-| ------------------ | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----- |
-| **`actionId`** | string | The identifier of the performed action. | 1.0.0 |
-| **`inputValue`** | string | The value entered by the user on the notification. Only available on iOS for notifications with `input` set to `true`. | 1.0.0 |
-| **`notification`** | LocalNotificationSchema | The original notification schema. | 1.0.0 |
-
-
-### Type Aliases
-
-
-#### ScheduleEvery
-
-'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second'
-
-
-#### InterruptionLevel
-
-The interruption level that indicates the priority and delivery timing of a notification.
-
-- `active`: The system presents the notification immediately, lights up the screen, and can play a sound.
-- `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.
- Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).
-- `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.
-- `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.
- Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.
- Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.
- See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.
-
-'active' | 'critical' | 'passive' | 'timeSensitive'
-
-
-#### Importance
-
-The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)
-
-0 | 1 | 2 | 3 | 4 | 5
-
-
-#### Visibility
-
-The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)
-
--1 | 0 | 1
-
-
-#### PermissionState
-
-'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
-
-
-### Enums
-
-
-#### Weekday
-
-| Members | Value |
-| --------------- | -------------- |
-| **`Sunday`** | 1 |
-| **`Monday`** | 2 |
-| **`Tuesday`** | 3 |
-| **`Wednesday`** | 4 |
-| **`Thursday`** | 5 |
-| **`Friday`** | 6 |
-| **`Saturday`** | 7 |
-
-
diff --git a/local-notifications/android/.gitignore b/local-notifications/android/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/local-notifications/android/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/local-notifications/android/build.gradle b/local-notifications/android/build.gradle
deleted file mode 100644
index 76dc782d7..000000000
--- a/local-notifications/android/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-ext {
- capacitorVersion = System.getenv('CAPACITOR_VERSION')
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
-}
-
-buildscript {
- repositories {
- google()
- mavenCentral()
- maven {
- url = "https://plugins.gradle.org/m2/"
- }
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:9.2.1'
- if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
- classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
- }
- }
-}
-
-apply plugin: 'com.android.library'
-if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
- apply plugin: 'io.github.gradle-nexus.publish-plugin'
- apply from: file('../../scripts/android/publish-root.gradle')
- apply from: file('../../scripts/android/publish-module.gradle')
-}
-
-android {
- namespace = "com.capacitorjs.plugins.localnotifications"
- compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
- defaultConfig {
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- lintOptions {
- abortOnError = false
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_21
- targetCompatibility JavaVersion.VERSION_21
- }
- publishing {
- singleVariant("release")
- }
-}
-
-repositories {
- google()
- mavenCentral()
-}
-
-
-dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
-
- if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
- implementation "com.capacitorjs:core:$capacitorVersion"
- } else {
- implementation project(':capacitor-android')
- }
-
- implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
- testImplementation "junit:junit:$junitVersion"
- androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
- androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
-}
diff --git a/local-notifications/android/gradle.properties b/local-notifications/android/gradle.properties
deleted file mode 100644
index 2e87c52f8..000000000
--- a/local-notifications/android/gradle.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-
-# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app's APK
-# https://developer.android.com/topic/libraries/support-library/androidx-rn
-android.useAndroidX=true
diff --git a/local-notifications/android/gradle/wrapper/gradle-wrapper.jar b/local-notifications/android/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index b1b8ef56b..000000000
Binary files a/local-notifications/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/local-notifications/android/gradle/wrapper/gradle-wrapper.properties b/local-notifications/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e74c8700b..000000000
--- a/local-notifications/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-all.zip
-networkTimeout=10000
-retries=0
-retryBackOffMs=500
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/local-notifications/android/gradlew b/local-notifications/android/gradlew
deleted file mode 100755
index b9bb139f7..000000000
--- a/local-notifications/android/gradlew
+++ /dev/null
@@ -1,248 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright © 2015 the original authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-# * compound commands having a testable exit status, especially «case»;
-# * various built-in commands including «command», «set», and «ulimit».
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-# This is normally unused
-# shellcheck disable=SC2034
-APP_BASE_NAME=${0##*/}
-# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- if ! command -v java >/dev/null 2>&1
- then
- die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/local-notifications/android/gradlew.bat b/local-notifications/android/gradlew.bat
deleted file mode 100644
index aa5f10b06..000000000
--- a/local-notifications/android/gradlew.bat
+++ /dev/null
@@ -1,82 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-@rem SPDX-License-Identifier: Apache-2.0
-@rem
-
-@if "%DEBUG%"=="" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables, and ensure extensions are enabled
-setlocal EnableExtensions
-
-set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-"%COMSPEC%" /c exit 1
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-"%COMSPEC%" /c exit 1
-
-:execute
-@rem Setup the command line
-
-
-
-@rem Execute Gradle
-@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
-@rem which allows us to clear the local environment before executing the java command
-endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
-
-:exitWithErrorLevel
-@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
-"%COMSPEC%" /c exit %ERRORLEVEL%
diff --git a/local-notifications/android/proguard-rules.pro b/local-notifications/android/proguard-rules.pro
deleted file mode 100644
index f1b424510..000000000
--- a/local-notifications/android/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
diff --git a/local-notifications/android/settings.gradle b/local-notifications/android/settings.gradle
deleted file mode 100644
index 1e5b8431f..000000000
--- a/local-notifications/android/settings.gradle
+++ /dev/null
@@ -1,2 +0,0 @@
-include ':capacitor-android'
-project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
\ No newline at end of file
diff --git a/local-notifications/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java b/local-notifications/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java
deleted file mode 100644
index 58020e16c..000000000
--- a/local-notifications/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.getcapacitor.android;
-
-import static org.junit.Assert.*;
-
-import android.content.Context;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.platform.app.InstrumentationRegistry;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-
- assertEquals("com.getcapacitor.android", appContext.getPackageName());
- }
-}
diff --git a/local-notifications/android/src/main/AndroidManifest.xml b/local-notifications/android/src/main/AndroidManifest.xml
deleted file mode 100644
index 04e785d44..000000000
--- a/local-notifications/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/DateMatch.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/DateMatch.java
deleted file mode 100644
index bf23d0085..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/DateMatch.java
+++ /dev/null
@@ -1,291 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import java.util.Calendar;
-import java.util.Date;
-
-/**
- * Class that holds logic for on triggers
- * (Specific time)
- */
-public class DateMatch {
-
- private static final String separator = " ";
-
- private Integer year;
- private Integer month;
- private Integer day;
- private Integer weekday;
- private Integer hour;
- private Integer minute;
- private Integer second;
-
- // Unit used to save the last used unit for a trigger.
- // One of the Calendar constants values
- private Integer unit = -1;
-
- public DateMatch() {}
-
- public Integer getYear() {
- return year;
- }
-
- public void setYear(Integer year) {
- this.year = year;
- }
-
- public Integer getMonth() {
- return month;
- }
-
- public void setMonth(Integer month) {
- this.month = month;
- }
-
- public Integer getDay() {
- return day;
- }
-
- public void setDay(Integer day) {
- this.day = day;
- }
-
- public Integer getWeekday() {
- return weekday;
- }
-
- public void setWeekday(Integer weekday) {
- this.weekday = weekday;
- }
-
- public Integer getHour() {
- return hour;
- }
-
- public void setHour(Integer hour) {
- this.hour = hour;
- }
-
- public Integer getMinute() {
- return minute;
- }
-
- public void setMinute(Integer minute) {
- this.minute = minute;
- }
-
- public Integer getSecond() {
- return second;
- }
-
- public void setSecond(Integer second) {
- this.second = second;
- }
-
- /**
- * Gets a calendar instance pointing to the specified date.
- *
- * @param date The date to point.
- */
- private Calendar buildCalendar(Date date) {
- Calendar cal = Calendar.getInstance();
- cal.setTime(date);
- cal.set(Calendar.MILLISECOND, 0);
- return cal;
- }
-
- /**
- * Calculates next trigger date for
- *
- * @param date base date used to calculate trigger
- * @return next trigger timestamp
- */
- public long nextTrigger(Date date) {
- Calendar current = buildCalendar(date);
- Calendar next = buildNextTriggerTime(date);
- return postponeTriggerIfNeeded(current, next);
- }
-
- /**
- * Postpone trigger if first schedule matches the past
- */
- private long postponeTriggerIfNeeded(Calendar current, Calendar next) {
- if (next.getTimeInMillis() <= current.getTimeInMillis() && unit != -1) {
- Integer incrementUnit = -1;
- if (unit == Calendar.YEAR || unit == Calendar.MONTH) {
- incrementUnit = Calendar.YEAR;
- } else if (unit == Calendar.DAY_OF_MONTH) {
- incrementUnit = Calendar.MONTH;
- } else if (unit == Calendar.DAY_OF_WEEK) {
- incrementUnit = Calendar.WEEK_OF_MONTH;
- } else if (unit == Calendar.HOUR_OF_DAY) {
- incrementUnit = Calendar.DAY_OF_MONTH;
- } else if (unit == Calendar.MINUTE) {
- incrementUnit = Calendar.HOUR_OF_DAY;
- } else if (unit == Calendar.SECOND) {
- incrementUnit = Calendar.MINUTE;
- }
-
- if (incrementUnit != -1) {
- next.set(incrementUnit, next.get(incrementUnit) + 1);
- }
- }
- return next.getTimeInMillis();
- }
-
- private Calendar buildNextTriggerTime(Date date) {
- Calendar next = buildCalendar(date);
- if (year != null) {
- next.set(Calendar.YEAR, year);
- if (unit == -1) unit = Calendar.YEAR;
- }
- if (month != null) {
- next.set(Calendar.MONTH, month);
- if (unit == -1) unit = Calendar.MONTH;
- }
- if (day != null) {
- next.set(Calendar.DAY_OF_MONTH, day);
- if (unit == -1) unit = Calendar.DAY_OF_MONTH;
- }
- if (weekday != null) {
- next.set(Calendar.DAY_OF_WEEK, weekday);
- if (unit == -1) unit = Calendar.DAY_OF_WEEK;
- }
- if (hour != null) {
- next.set(Calendar.HOUR_OF_DAY, hour);
- if (unit == -1) unit = Calendar.HOUR_OF_DAY;
- }
- if (minute != null) {
- next.set(Calendar.MINUTE, minute);
- if (unit == -1) unit = Calendar.MINUTE;
- }
- if (second != null) {
- next.set(Calendar.SECOND, second);
- if (unit == -1) unit = Calendar.SECOND;
- }
- return next;
- }
-
- @Override
- public String toString() {
- return (
- "DateMatch{" +
- "year=" +
- year +
- ", month=" +
- month +
- ", day=" +
- day +
- ", weekday=" +
- weekday +
- ", hour=" +
- hour +
- ", minute=" +
- minute +
- ", second=" +
- second +
- '}'
- );
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- DateMatch dateMatch = (DateMatch) o;
-
- if (year != null ? !year.equals(dateMatch.year) : dateMatch.year != null) return false;
- if (month != null ? !month.equals(dateMatch.month) : dateMatch.month != null) return false;
- if (day != null ? !day.equals(dateMatch.day) : dateMatch.day != null) return false;
- if (weekday != null ? !weekday.equals(dateMatch.weekday) : dateMatch.weekday != null) return false;
- if (hour != null ? !hour.equals(dateMatch.hour) : dateMatch.hour != null) return false;
- if (minute != null ? !minute.equals(dateMatch.minute) : dateMatch.minute != null) return false;
- return second != null ? second.equals(dateMatch.second) : dateMatch.second == null;
- }
-
- @Override
- public int hashCode() {
- int result = year != null ? year.hashCode() : 0;
- result = 31 * result + (month != null ? month.hashCode() : 0);
- result = 31 * result + (day != null ? day.hashCode() : 0);
- result = 31 * result + (weekday != null ? weekday.hashCode() : 0);
- result = 31 * result + (hour != null ? hour.hashCode() : 0);
- result = 31 * result + (minute != null ? minute.hashCode() : 0);
- result = 31 + result + (second != null ? second.hashCode() : 0);
- return result;
- }
-
- /**
- * Transform DateMatch object to CronString
- *
- * @return
- */
- public String toMatchString() {
- String matchString =
- year +
- separator +
- month +
- separator +
- day +
- separator +
- weekday +
- separator +
- hour +
- separator +
- minute +
- separator +
- second +
- separator +
- unit;
- return matchString.replace("null", "*");
- }
-
- /**
- * Create DateMatch object from stored string
- *
- * @param matchString
- * @return
- */
- public static DateMatch fromMatchString(String matchString) {
- DateMatch date = new DateMatch();
- String[] split = matchString.split(separator);
- if (split != null && split.length == 7) {
- date.setYear(getValueFromCronElement(split[0]));
- date.setMonth(getValueFromCronElement(split[1]));
- date.setDay(getValueFromCronElement(split[2]));
- date.setWeekday(getValueFromCronElement(split[3]));
- date.setHour(getValueFromCronElement(split[4]));
- date.setMinute(getValueFromCronElement(split[5]));
- date.setUnit(getValueFromCronElement(split[6]));
- }
-
- if (split != null && split.length == 8) {
- date.setYear(getValueFromCronElement(split[0]));
- date.setMonth(getValueFromCronElement(split[1]));
- date.setDay(getValueFromCronElement(split[2]));
- date.setWeekday(getValueFromCronElement(split[3]));
- date.setHour(getValueFromCronElement(split[4]));
- date.setMinute(getValueFromCronElement(split[5]));
- date.setSecond(getValueFromCronElement(split[6]));
- date.setUnit(getValueFromCronElement(split[7]));
- }
-
- return date;
- }
-
- public static Integer getValueFromCronElement(String token) {
- try {
- return Integer.parseInt(token);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- public Integer getUnit() {
- return unit;
- }
-
- public void setUnit(Integer unit) {
- this.unit = unit;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotification.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotification.java
deleted file mode 100644
index 7463256d4..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotification.java
+++ /dev/null
@@ -1,466 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import com.getcapacitor.JSArray;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.Logger;
-import com.getcapacitor.PluginCall;
-import com.getcapacitor.plugin.util.AssetUtil;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Local notification object mapped from json plugin
- */
-public class LocalNotification {
-
- private String title;
- private String body;
- private String largeBody;
- private String summaryText;
- private Integer id;
- private String sound;
- private String smallIcon;
- private String largeIcon;
- private String iconColor;
- private String actionTypeId;
- private String group;
- private List inboxList;
- private boolean groupSummary;
- private boolean ongoing;
- private boolean autoCancel;
- private JSObject extra;
- private List attachments;
- private LocalNotificationSchedule schedule;
- private String channelId;
- private String source;
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public void setLargeBody(String largeBody) {
- this.largeBody = largeBody;
- }
-
- public String getLargeBody() {
- return this.largeBody;
- }
-
- public void setSummaryText(String summaryText) {
- this.summaryText = summaryText;
- }
-
- public String getSummaryText() {
- return this.summaryText;
- }
-
- public LocalNotificationSchedule getSchedule() {
- return schedule;
- }
-
- public void setSchedule(LocalNotificationSchedule schedule) {
- this.schedule = schedule;
- }
-
- public String getSound(Context context, int defaultSound) {
- String soundPath = null;
- int resId = AssetUtil.RESOURCE_ID_ZERO_VALUE;
- String name = AssetUtil.getResourceBaseName(sound);
- if (name != null) {
- resId = AssetUtil.getResourceID(context, name, "raw");
- }
- if (resId == AssetUtil.RESOURCE_ID_ZERO_VALUE) {
- resId = defaultSound;
- }
- if (resId != AssetUtil.RESOURCE_ID_ZERO_VALUE) {
- soundPath = ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/" + resId;
- }
- return soundPath;
- }
-
- public void setSound(String sound) {
- this.sound = sound;
- }
-
- public void setSmallIcon(String smallIcon) {
- this.smallIcon = AssetUtil.getResourceBaseName(smallIcon);
- }
-
- public void setLargeIcon(String largeIcon) {
- this.largeIcon = AssetUtil.getResourceBaseName(largeIcon);
- }
-
- public void setInboxList(List inboxList) {
- this.inboxList = inboxList;
- }
-
- public List getInboxList() {
- return this.inboxList;
- }
-
- public String getIconColor(String globalColor) {
- // use the one defined local before trying for a globally defined color
- if (iconColor != null) {
- return iconColor;
- }
-
- return globalColor;
- }
-
- public void setIconColor(String iconColor) {
- this.iconColor = iconColor;
- }
-
- public List getAttachments() {
- return attachments;
- }
-
- public void setAttachments(List attachments) {
- this.attachments = attachments;
- }
-
- public String getActionTypeId() {
- return actionTypeId;
- }
-
- public void setActionTypeId(String actionTypeId) {
- this.actionTypeId = actionTypeId;
- }
-
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-
- public JSObject getExtra() {
- return extra;
- }
-
- public void setExtra(JSObject extra) {
- this.extra = extra;
- }
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public boolean isGroupSummary() {
- return groupSummary;
- }
-
- public void setGroupSummary(boolean groupSummary) {
- this.groupSummary = groupSummary;
- }
-
- public boolean isOngoing() {
- return ongoing;
- }
-
- public void setOngoing(boolean ongoing) {
- this.ongoing = ongoing;
- }
-
- public boolean isAutoCancel() {
- return autoCancel;
- }
-
- public void setAutoCancel(boolean autoCancel) {
- this.autoCancel = autoCancel;
- }
-
- public String getChannelId() {
- return channelId;
- }
-
- public void setChannelId(String channelId) {
- this.channelId = channelId;
- }
-
- /**
- * Build list of the notifications from remote plugin call
- */
- public static List buildNotificationList(PluginCall call) {
- JSArray notificationArray = call.getArray("notifications");
- if (notificationArray == null) {
- call.reject("Must provide notifications array as notifications option");
- return null;
- }
- List resultLocalNotifications = new ArrayList<>(notificationArray.length());
- List notificationsJson;
- try {
- notificationsJson = notificationArray.toList();
- } catch (JSONException e) {
- call.reject("Provided notification format is invalid");
- return null;
- }
-
- for (JSONObject jsonNotification : notificationsJson) {
- JSObject notification = null;
- try {
- long identifier = jsonNotification.getLong("id");
- if (identifier > Integer.MAX_VALUE || identifier < Integer.MIN_VALUE) {
- call.reject("The identifier should be a Java int");
- return null;
- }
- notification = JSObject.fromJSONObject(jsonNotification);
- } catch (JSONException e) {
- call.reject("Invalid JSON object sent to NotificationPlugin", e);
- return null;
- }
-
- try {
- LocalNotification activeLocalNotification = buildNotificationFromJSObject(notification);
- resultLocalNotifications.add(activeLocalNotification);
- } catch (ParseException e) {
- call.reject("Invalid date format sent to Notification plugin", e);
- return null;
- }
- }
- return resultLocalNotifications;
- }
-
- public static LocalNotification buildNotificationFromJSObject(JSObject jsonObject) throws ParseException {
- LocalNotification localNotification = new LocalNotification();
- localNotification.setSource(jsonObject.toString());
- localNotification.setId(jsonObject.getInteger("id"));
- localNotification.setBody(jsonObject.getString("body"));
- localNotification.setLargeBody(jsonObject.getString("largeBody"));
- localNotification.setSummaryText(jsonObject.getString("summaryText"));
- localNotification.setActionTypeId(jsonObject.getString("actionTypeId"));
- localNotification.setGroup(jsonObject.getString("group"));
- localNotification.setSound(jsonObject.getString("sound"));
- localNotification.setTitle(jsonObject.getString("title"));
- localNotification.setSmallIcon(jsonObject.getString("smallIcon"));
- localNotification.setLargeIcon(jsonObject.getString("largeIcon"));
- localNotification.setIconColor(jsonObject.getString("iconColor"));
- localNotification.setAttachments(LocalNotificationAttachment.getAttachments(jsonObject));
- localNotification.setGroupSummary(jsonObject.getBoolean("groupSummary", false));
- localNotification.setChannelId(jsonObject.getString("channelId"));
- JSObject schedule = jsonObject.getJSObject("schedule");
- if (schedule != null) {
- localNotification.setSchedule(new LocalNotificationSchedule(schedule));
- }
- localNotification.setExtra(jsonObject.getJSObject("extra"));
- localNotification.setOngoing(jsonObject.getBoolean("ongoing", false));
- localNotification.setAutoCancel(jsonObject.getBoolean("autoCancel", true));
-
- try {
- JSONArray inboxList = jsonObject.getJSONArray("inboxList");
- if (inboxList != null) {
- List inboxStringList = new ArrayList<>();
- for (int i = 0; i < inboxList.length(); i++) {
- inboxStringList.add(inboxList.getString(i));
- }
- localNotification.setInboxList(inboxStringList);
- }
- } catch (Exception ex) {}
-
- return localNotification;
- }
-
- public static List getLocalNotificationPendingList(PluginCall call) {
- List notifications = null;
- try {
- notifications = call.getArray("notifications").toList();
- } catch (JSONException e) {}
- if (notifications == null || notifications.size() == 0) {
- call.reject("Must provide notifications array as notifications option");
- return null;
- }
- List notificationsList = new ArrayList<>(notifications.size());
- for (JSONObject notificationToCancel : notifications) {
- try {
- notificationsList.add(notificationToCancel.getInt("id"));
- } catch (JSONException e) {}
- }
- return notificationsList;
- }
-
- public static JSObject buildLocalNotificationPendingList(List notifications) {
- JSObject result = new JSObject();
- JSArray jsArray = new JSArray();
- for (LocalNotification notification : notifications) {
- JSObject jsNotification = new JSObject();
- jsNotification.put("id", notification.getId());
- jsNotification.put("title", notification.getTitle());
- jsNotification.put("body", notification.getBody());
- LocalNotificationSchedule schedule = notification.getSchedule();
- if (schedule != null) {
- JSObject jsSchedule = new JSObject();
- jsSchedule.put("at", schedule.getAt());
- jsSchedule.put("every", schedule.getEvery());
- jsSchedule.put("count", schedule.getCount());
- jsSchedule.put("on", schedule.getOnObj());
- jsSchedule.put("repeats", schedule.isRepeating());
- jsNotification.put("schedule", jsSchedule);
- }
-
- jsNotification.put("extra", notification.getExtra());
-
- jsArray.put(jsNotification);
- }
- result.put("notifications", jsArray);
- return result;
- }
-
- public int getSmallIcon(Context context, int defaultIcon) {
- int resId = AssetUtil.RESOURCE_ID_ZERO_VALUE;
-
- if (smallIcon != null) {
- resId = AssetUtil.getResourceID(context, smallIcon, "drawable");
- }
-
- if (resId == AssetUtil.RESOURCE_ID_ZERO_VALUE) {
- resId = defaultIcon;
- }
-
- return resId;
- }
-
- public Bitmap getLargeIcon(Context context) {
- if (largeIcon != null) {
- int resId = AssetUtil.getResourceID(context, largeIcon, "drawable");
- return BitmapFactory.decodeResource(context.getResources(), resId);
- }
-
- return null;
- }
-
- public boolean isScheduled() {
- return (
- this.schedule != null && (this.schedule.getOn() != null || this.schedule.getAt() != null || this.schedule.getEvery() != null)
- );
- }
-
- @Override
- public String toString() {
- return (
- "LocalNotification{" +
- "title='" +
- title +
- '\'' +
- ", body='" +
- body +
- '\'' +
- ", id=" +
- id +
- ", sound='" +
- sound +
- '\'' +
- ", smallIcon='" +
- smallIcon +
- '\'' +
- ", iconColor='" +
- iconColor +
- '\'' +
- ", actionTypeId='" +
- actionTypeId +
- '\'' +
- ", group='" +
- group +
- '\'' +
- ", extra=" +
- extra +
- ", attachments=" +
- attachments +
- ", schedule=" +
- schedule +
- ", groupSummary=" +
- groupSummary +
- ", ongoing=" +
- ongoing +
- ", autoCancel=" +
- autoCancel +
- '}'
- );
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- LocalNotification that = (LocalNotification) o;
-
- if (title != null ? !title.equals(that.title) : that.title != null) return false;
- if (body != null ? !body.equals(that.body) : that.body != null) return false;
- if (largeBody != null ? !largeBody.equals(that.largeBody) : that.largeBody != null) return false;
- if (id != null ? !id.equals(that.id) : that.id != null) return false;
- if (sound != null ? !sound.equals(that.sound) : that.sound != null) return false;
- if (smallIcon != null ? !smallIcon.equals(that.smallIcon) : that.smallIcon != null) return false;
- if (largeIcon != null ? !largeIcon.equals(that.largeIcon) : that.largeIcon != null) return false;
- if (iconColor != null ? !iconColor.equals(that.iconColor) : that.iconColor != null) return false;
- if (actionTypeId != null ? !actionTypeId.equals(that.actionTypeId) : that.actionTypeId != null) return false;
- if (group != null ? !group.equals(that.group) : that.group != null) return false;
- if (extra != null ? !extra.equals(that.extra) : that.extra != null) return false;
- if (attachments != null ? !attachments.equals(that.attachments) : that.attachments != null) return false;
- if (inboxList != null ? !inboxList.equals(that.inboxList) : that.inboxList != null) return false;
- if (groupSummary != that.groupSummary) return false;
- if (ongoing != that.ongoing) return false;
- if (autoCancel != that.autoCancel) return false;
- return schedule != null ? schedule.equals(that.schedule) : that.schedule == null;
- }
-
- @Override
- public int hashCode() {
- int result = title != null ? title.hashCode() : 0;
- result = 31 * result + (body != null ? body.hashCode() : 0);
- result = 31 * result + (id != null ? id.hashCode() : 0);
- result = 31 * result + (sound != null ? sound.hashCode() : 0);
- result = 31 * result + (smallIcon != null ? smallIcon.hashCode() : 0);
- result = 31 * result + (iconColor != null ? iconColor.hashCode() : 0);
- result = 31 * result + (actionTypeId != null ? actionTypeId.hashCode() : 0);
- result = 31 * result + (group != null ? group.hashCode() : 0);
- result = 31 * result + Boolean.hashCode(groupSummary);
- result = 31 * result + Boolean.hashCode(ongoing);
- result = 31 * result + Boolean.hashCode(autoCancel);
- result = 31 * result + (extra != null ? extra.hashCode() : 0);
- result = 31 * result + (attachments != null ? attachments.hashCode() : 0);
- result = 31 * result + (schedule != null ? schedule.hashCode() : 0);
- return result;
- }
-
- public void setExtraFromString(String extraFromString) {
- try {
- JSONObject jsonObject = new JSONObject(extraFromString);
- this.extra = JSObject.fromJSONObject(jsonObject);
- } catch (JSONException e) {
- Logger.error(Logger.tags("LN"), "Cannot rebuild extra data", e);
- }
- }
-
- public String getSource() {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationAttachment.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationAttachment.java
deleted file mode 100644
index 8b4ead25c..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationAttachment.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import com.getcapacitor.JSObject;
-import java.util.ArrayList;
-import java.util.List;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class LocalNotificationAttachment {
-
- private String id;
- private String url;
- private JSONObject options;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public JSONObject getOptions() {
- return options;
- }
-
- public void setOptions(JSONObject options) {
- this.options = options;
- }
-
- public static List getAttachments(JSObject notification) {
- List attachmentsList = new ArrayList<>();
- JSONArray attachments = null;
- try {
- attachments = notification.getJSONArray("attachments");
- } catch (Exception e) {}
- if (attachments != null) {
- for (int i = 0; i < attachments.length(); i++) {
- LocalNotificationAttachment newAttachment = new LocalNotificationAttachment();
- JSONObject jsonObject = null;
- try {
- jsonObject = attachments.getJSONObject(i);
- } catch (JSONException e) {}
- if (jsonObject != null) {
- JSObject jsObject = null;
- try {
- jsObject = JSObject.fromJSONObject(jsonObject);
- } catch (JSONException e) {}
- newAttachment.setId(jsObject.getString("id"));
- newAttachment.setUrl(jsObject.getString("url"));
- try {
- newAttachment.setOptions(jsObject.getJSONObject("options"));
- } catch (JSONException e) {}
- attachmentsList.add(newAttachment);
- }
- }
- }
-
- return attachmentsList;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java
deleted file mode 100644
index a521128d7..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java
+++ /dev/null
@@ -1,471 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.app.Activity;
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.PendingIntent;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Color;
-import android.media.AudioAttributes;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.NotificationCompat;
-import androidx.core.app.NotificationManagerCompat;
-import androidx.core.app.RemoteInput;
-import com.getcapacitor.CapConfig;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.Logger;
-import com.getcapacitor.PluginCall;
-import com.getcapacitor.PluginConfig;
-import com.getcapacitor.plugin.util.AssetUtil;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Contains implementations for all notification actions
- */
-public class LocalNotificationManager {
-
- private static int defaultSoundID = AssetUtil.RESOURCE_ID_ZERO_VALUE;
- private static int defaultSmallIconID = AssetUtil.RESOURCE_ID_ZERO_VALUE;
- // Action constants
- public static final String NOTIFICATION_INTENT_KEY = "LocalNotificationId";
- public static final String NOTIFICATION_OBJ_INTENT_KEY = "LocalNotficationObject";
- public static final String ACTION_INTENT_KEY = "LocalNotificationUserAction";
- public static final String NOTIFICATION_IS_REMOVABLE_KEY = "LocalNotificationRepeating";
- public static final String REMOTE_INPUT_KEY = "LocalNotificationRemoteInput";
-
- public static final String DEFAULT_NOTIFICATION_CHANNEL_ID = "default";
- private static final String DEFAULT_PRESS_ACTION = "tap";
-
- private Context context;
- private Activity activity;
- private NotificationStorage storage;
- private PluginConfig config;
-
- public LocalNotificationManager(NotificationStorage notificationStorage, Activity activity, Context context, CapConfig config) {
- storage = notificationStorage;
- this.activity = activity;
- this.context = context;
- this.config = config.getPluginConfiguration("LocalNotifications");
- }
-
- /**
- * Method extecuted when notification is launched by user from the notification bar.
- */
- public JSObject handleNotificationActionPerformed(Intent data, NotificationStorage notificationStorage) {
- Logger.debug(Logger.tags("LN"), "LocalNotification received: " + data.getDataString());
- int notificationId = data.getIntExtra(LocalNotificationManager.NOTIFICATION_INTENT_KEY, Integer.MIN_VALUE);
- if (notificationId == Integer.MIN_VALUE) {
- Logger.debug(Logger.tags("LN"), "Activity started without notification attached");
- return null;
- }
- boolean isRemovable = data.getBooleanExtra(LocalNotificationManager.NOTIFICATION_IS_REMOVABLE_KEY, true);
- if (isRemovable) {
- notificationStorage.deleteNotification(Integer.toString(notificationId));
- }
- JSObject dataJson = new JSObject();
-
- Bundle results = RemoteInput.getResultsFromIntent(data);
- if (results != null) {
- CharSequence input = results.getCharSequence(LocalNotificationManager.REMOTE_INPUT_KEY);
- dataJson.put("inputValue", input.toString());
- }
- String menuAction = data.getStringExtra(LocalNotificationManager.ACTION_INTENT_KEY);
-
- dismissVisibleNotification(notificationId);
-
- dataJson.put("actionId", menuAction);
- JSONObject request = null;
- try {
- String notificationJsonString = data.getStringExtra(LocalNotificationManager.NOTIFICATION_OBJ_INTENT_KEY);
- if (notificationJsonString != null) {
- request = new JSObject(notificationJsonString);
- }
- } catch (JSONException e) {}
- dataJson.put("notification", request);
- return dataJson;
- }
-
- /**
- * Create notification channel
- */
- public void createNotificationChannel() {
- CharSequence name = "Default";
- String description = "Default";
- int importance = android.app.NotificationManager.IMPORTANCE_DEFAULT;
- NotificationChannel channel = new NotificationChannel(DEFAULT_NOTIFICATION_CHANNEL_ID, name, importance);
- channel.setDescription(description);
- AudioAttributes audioAttributes = new AudioAttributes.Builder()
- .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
- .setUsage(AudioAttributes.USAGE_ALARM)
- .build();
- Uri soundUri = this.getDefaultSoundUrl(context);
- if (soundUri != null) {
- channel.setSound(soundUri, audioAttributes);
- }
- // Register the channel with the system; you can't change the importance
- // or other notification behaviors after this
- android.app.NotificationManager notificationManager = context.getSystemService(android.app.NotificationManager.class);
- notificationManager.createNotificationChannel(channel);
- }
-
- @Nullable
- public JSONArray schedule(PluginCall call, List localNotifications) {
- JSONArray ids = new JSONArray();
- NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
-
- boolean notificationsEnabled = notificationManager.areNotificationsEnabled();
- if (!notificationsEnabled) {
- if (call != null) {
- call.reject("Notifications not enabled on this device");
- }
- return null;
- }
- for (LocalNotification localNotification : localNotifications) {
- Integer id = localNotification.getId();
- if (localNotification.getId() == null) {
- if (call != null) {
- call.reject("LocalNotification missing identifier");
- }
- return null;
- }
- dismissVisibleNotification(id);
- cancelTimerForNotification(id);
- buildNotification(notificationManager, localNotification, call);
- ids.put(id);
- }
- return ids;
- }
-
- // TODO Progressbar support
- // TODO System categories (DO_NOT_DISTURB etc.)
- // TODO control visibility by flag Notification.VISIBILITY_PRIVATE
- // TODO Group notifications (setGroup, setGroupSummary, setNumber)
- // TODO use NotificationCompat.MessagingStyle for latest API
- // TODO expandable notification NotificationCompat.MessagingStyle
- // TODO media style notification support NotificationCompat.MediaStyle
- // TODO custom small/large icons
- private void buildNotification(NotificationManagerCompat notificationManager, LocalNotification localNotification, PluginCall call) {
- String channelId = DEFAULT_NOTIFICATION_CHANNEL_ID;
- if (localNotification.getChannelId() != null) {
- channelId = localNotification.getChannelId();
- }
- NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this.context, channelId)
- .setContentTitle(localNotification.getTitle())
- .setContentText(localNotification.getBody())
- .setAutoCancel(localNotification.isAutoCancel())
- .setOngoing(localNotification.isOngoing())
- .setPriority(NotificationCompat.PRIORITY_DEFAULT)
- .setGroupSummary(localNotification.isGroupSummary());
-
- if (localNotification.getLargeBody() != null) {
- // support multiline text
- mBuilder.setStyle(
- new NotificationCompat.BigTextStyle()
- .bigText(localNotification.getLargeBody())
- .setSummaryText(localNotification.getSummaryText())
- );
- }
-
- if (localNotification.getInboxList() != null) {
- NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
- for (String line : localNotification.getInboxList()) {
- inboxStyle.addLine(line);
- }
- inboxStyle.setBigContentTitle(localNotification.getTitle());
- inboxStyle.setSummaryText(localNotification.getSummaryText());
- mBuilder.setStyle(inboxStyle);
- }
-
- String sound = localNotification.getSound(context, getDefaultSound(context));
- if (sound != null) {
- Uri soundUri = Uri.parse(sound);
- // Grant permission to use sound
- context.grantUriPermission("com.android.systemui", soundUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
- mBuilder.setSound(soundUri);
- mBuilder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_LIGHTS);
- } else {
- mBuilder.setDefaults(Notification.DEFAULT_ALL);
- }
-
- String group = localNotification.getGroup();
- if (group != null) {
- mBuilder.setGroup(group);
- if (localNotification.isGroupSummary()) {
- mBuilder.setSubText(localNotification.getSummaryText());
- }
- }
-
- mBuilder.setVisibility(NotificationCompat.VISIBILITY_PRIVATE);
- mBuilder.setOnlyAlertOnce(true);
-
- mBuilder.setSmallIcon(localNotification.getSmallIcon(context, getDefaultSmallIcon(context)));
- mBuilder.setLargeIcon(localNotification.getLargeIcon(context));
-
- String iconColor = localNotification.getIconColor(config.getString("iconColor"));
- if (iconColor != null) {
- try {
- mBuilder.setColor(Color.parseColor(iconColor));
- } catch (IllegalArgumentException ex) {
- if (call != null) {
- call.reject("Invalid color provided. Must be a hex string (ex: #ff0000");
- }
- return;
- }
- }
-
- createActionIntents(localNotification, mBuilder);
- // notificationId is a unique int for each localNotification that you must define
- Notification buildNotification = mBuilder.build();
- if (localNotification.isScheduled()) {
- triggerScheduledNotification(buildNotification, localNotification);
- } else {
- try {
- JSObject notificationJson = new JSObject(localNotification.getSource());
- LocalNotificationsPlugin.fireReceived(notificationJson);
- } catch (JSONException e) {}
- notificationManager.notify(localNotification.getId(), buildNotification);
- }
- }
-
- // Create intents for open/dissmis actions
- private void createActionIntents(LocalNotification localNotification, NotificationCompat.Builder mBuilder) {
- // Open intent
- Intent intent = buildIntent(localNotification, DEFAULT_PRESS_ACTION);
- int flags = PendingIntent.FLAG_CANCEL_CURRENT;
- if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- flags = flags | PendingIntent.FLAG_MUTABLE;
- }
- PendingIntent pendingIntent = PendingIntent.getActivity(context, localNotification.getId(), intent, flags);
- mBuilder.setContentIntent(pendingIntent);
-
- // Build action types
- String actionTypeId = localNotification.getActionTypeId();
- if (actionTypeId != null) {
- NotificationAction[] actionGroup = storage.getActionGroup(actionTypeId);
- for (NotificationAction notificationAction : actionGroup) {
- // TODO Add custom icons to actions
- Intent actionIntent = buildIntent(localNotification, notificationAction.getId());
- PendingIntent actionPendingIntent = PendingIntent.getActivity(
- context,
- localNotification.getId() + notificationAction.getId().hashCode(),
- actionIntent,
- flags
- );
- NotificationCompat.Action.Builder actionBuilder = new NotificationCompat.Action.Builder(
- R.drawable.ic_transparent,
- notificationAction.getTitle(),
- actionPendingIntent
- );
- if (notificationAction.isInput()) {
- RemoteInput remoteInput = new RemoteInput.Builder(REMOTE_INPUT_KEY).setLabel(notificationAction.getTitle()).build();
- actionBuilder.addRemoteInput(remoteInput);
- }
- mBuilder.addAction(actionBuilder.build());
- }
- }
-
- // Dismiss intent
- Intent dissmissIntent = new Intent(context, NotificationDismissReceiver.class);
- dissmissIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- dissmissIntent.putExtra(NOTIFICATION_INTENT_KEY, localNotification.getId());
- dissmissIntent.putExtra(ACTION_INTENT_KEY, "dismiss");
- LocalNotificationSchedule schedule = localNotification.getSchedule();
- dissmissIntent.putExtra(NOTIFICATION_IS_REMOVABLE_KEY, schedule == null || schedule.isRemovable());
- flags = 0;
- if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- flags = PendingIntent.FLAG_MUTABLE;
- }
- PendingIntent deleteIntent = PendingIntent.getBroadcast(context, localNotification.getId(), dissmissIntent, flags);
- mBuilder.setDeleteIntent(deleteIntent);
- }
-
- @NonNull
- private Intent buildIntent(LocalNotification localNotification, String action) {
- Intent intent;
- if (activity != null) {
- intent = new Intent(context, activity.getClass());
- } else {
- String packageName = context.getPackageName();
- intent = context.getPackageManager().getLaunchIntentForPackage(packageName);
- }
- intent.setAction(Intent.ACTION_MAIN);
- intent.addCategory(Intent.CATEGORY_LAUNCHER);
- intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intent.putExtra(NOTIFICATION_INTENT_KEY, localNotification.getId());
- intent.putExtra(ACTION_INTENT_KEY, action);
- intent.putExtra(NOTIFICATION_OBJ_INTENT_KEY, localNotification.getSource());
- LocalNotificationSchedule schedule = localNotification.getSchedule();
- intent.putExtra(NOTIFICATION_IS_REMOVABLE_KEY, schedule == null || schedule.isRemovable());
- return intent;
- }
-
- /**
- * Build a notification trigger, such as triggering each N seconds, or
- * on a certain date "shape" (such as every first of the month)
- */
- // TODO support different AlarmManager.RTC modes depending on priority
- private void triggerScheduledNotification(Notification notification, LocalNotification request) {
- AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
- LocalNotificationSchedule schedule = request.getSchedule();
- Intent notificationIntent = new Intent(context, TimedNotificationPublisher.class);
- notificationIntent.putExtra(NOTIFICATION_INTENT_KEY, request.getId());
- notificationIntent.putExtra(TimedNotificationPublisher.NOTIFICATION_KEY, notification);
- int flags = PendingIntent.FLAG_CANCEL_CURRENT;
- if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- flags = flags | PendingIntent.FLAG_MUTABLE;
- }
- PendingIntent pendingIntent = PendingIntent.getBroadcast(context, request.getId(), notificationIntent, flags);
-
- // Schedule at specific time (with repeating support)
- Date at = schedule.getAt();
- if (at != null) {
- if (at.getTime() < new Date().getTime()) {
- Logger.error(Logger.tags("LN"), "Scheduled time must be *after* current time", null);
- return;
- }
- if (schedule.isRepeating()) {
- long interval = at.getTime() - new Date().getTime();
- alarmManager.setRepeating(AlarmManager.RTC, at.getTime(), interval, pendingIntent);
- } else {
- setExactIfPossible(alarmManager, schedule, at.getTime(), pendingIntent);
- }
- return;
- }
-
- // Schedule at specific intervals
- String every = schedule.getEvery();
- if (every != null) {
- Long everyInterval = schedule.getEveryInterval();
- if (everyInterval != null) {
- long startTime = new Date().getTime() + everyInterval;
- alarmManager.setRepeating(AlarmManager.RTC, startTime, everyInterval, pendingIntent);
- }
- return;
- }
-
- // Cron like scheduler
- DateMatch on = schedule.getOn();
- if (on != null) {
- long trigger = on.nextTrigger(new Date());
- notificationIntent.putExtra(TimedNotificationPublisher.CRON_KEY, on.toMatchString());
- pendingIntent = PendingIntent.getBroadcast(context, request.getId(), notificationIntent, flags);
- setExactIfPossible(alarmManager, schedule, trigger, pendingIntent);
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
- Logger.debug(Logger.tags("LN"), "notification " + request.getId() + " will next fire at " + sdf.format(new Date(trigger)));
- }
- }
-
- private void setExactIfPossible(
- AlarmManager alarmManager,
- LocalNotificationSchedule schedule,
- long trigger,
- PendingIntent pendingIntent
- ) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !alarmManager.canScheduleExactAlarms()) {
- Logger.warn(
- "Capacitor/LocalNotification",
- "Exact alarms not allowed in user settings. Notification scheduled with non-exact alarm."
- );
- if (schedule.allowWhileIdle()) {
- alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent);
- } else {
- alarmManager.set(AlarmManager.RTC, trigger, pendingIntent);
- }
- } else {
- if (schedule.allowWhileIdle()) {
- alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent);
- } else {
- alarmManager.setExact(AlarmManager.RTC, trigger, pendingIntent);
- }
- }
- }
-
- public void cancel(PluginCall call) {
- List notificationsToCancel = LocalNotification.getLocalNotificationPendingList(call);
- if (notificationsToCancel != null) {
- for (Integer id : notificationsToCancel) {
- dismissVisibleNotification(id);
- cancelTimerForNotification(id);
- storage.deleteNotification(Integer.toString(id));
- }
- }
- call.resolve();
- }
-
- private void cancelTimerForNotification(Integer notificationId) {
- Intent intent = new Intent(context, TimedNotificationPublisher.class);
- int flags = 0;
- if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- flags = PendingIntent.FLAG_MUTABLE;
- }
- PendingIntent pi = PendingIntent.getBroadcast(context, notificationId, intent, flags);
- if (pi != null) {
- AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
- alarmManager.cancel(pi);
- }
- }
-
- private void dismissVisibleNotification(int notificationId) {
- NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this.context);
- notificationManager.cancel(notificationId);
- }
-
- public boolean areNotificationsEnabled() {
- NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
- return notificationManager.areNotificationsEnabled();
- }
-
- public Uri getDefaultSoundUrl(Context context) {
- int soundId = this.getDefaultSound(context);
- if (soundId != AssetUtil.RESOURCE_ID_ZERO_VALUE) {
- return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/" + soundId);
- }
- return null;
- }
-
- private int getDefaultSound(Context context) {
- if (defaultSoundID != AssetUtil.RESOURCE_ID_ZERO_VALUE) return defaultSoundID;
-
- int resId = AssetUtil.RESOURCE_ID_ZERO_VALUE;
- String soundConfigResourceName = config.getString("sound");
- soundConfigResourceName = AssetUtil.getResourceBaseName(soundConfigResourceName);
-
- if (soundConfigResourceName != null) {
- resId = AssetUtil.getResourceID(context, soundConfigResourceName, "raw");
- }
-
- defaultSoundID = resId;
- return resId;
- }
-
- private int getDefaultSmallIcon(Context context) {
- if (defaultSmallIconID != AssetUtil.RESOURCE_ID_ZERO_VALUE) return defaultSmallIconID;
-
- int resId = AssetUtil.RESOURCE_ID_ZERO_VALUE;
- String smallIconConfigResourceName = config.getString("smallIcon");
- smallIconConfigResourceName = AssetUtil.getResourceBaseName(smallIconConfigResourceName);
-
- if (smallIconConfigResourceName != null) {
- resId = AssetUtil.getResourceID(context, smallIconConfigResourceName, "drawable");
- }
-
- if (resId == AssetUtil.RESOURCE_ID_ZERO_VALUE) {
- resId = android.R.drawable.ic_dialog_info;
- }
-
- defaultSmallIconID = resId;
- return resId;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationRestoreReceiver.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationRestoreReceiver.java
deleted file mode 100644
index 8e0390f08..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationRestoreReceiver.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.UserManager;
-import com.getcapacitor.CapConfig;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-public class LocalNotificationRestoreReceiver extends BroadcastReceiver {
-
- @Override
- public void onReceive(Context context, Intent intent) {
- UserManager um = context.getSystemService(UserManager.class);
- if (um == null || !um.isUserUnlocked()) return;
-
- NotificationStorage storage = new NotificationStorage(context);
- List ids = storage.getSavedNotificationIds();
-
- ArrayList notifications = new ArrayList<>(ids.size());
- ArrayList updatedNotifications = new ArrayList<>();
- for (String id : ids) {
- LocalNotification notification = storage.getSavedNotification(id);
- if (notification == null) {
- continue;
- }
-
- LocalNotificationSchedule schedule = notification.getSchedule();
- if (schedule != null) {
- Date at = schedule.getAt();
- if (at != null && at.before(new Date())) {
- // modify the scheduled date in order to show notifications that would have been delivered while device was off.
- long newDateTime = new Date().getTime() + 15 * 1000;
- schedule.setAt(new Date(newDateTime));
- notification.setSchedule(schedule);
- updatedNotifications.add(notification);
- }
- }
-
- notifications.add(notification);
- }
-
- if (updatedNotifications.size() > 0) {
- storage.appendNotifications(updatedNotifications);
- }
-
- CapConfig config = CapConfig.loadDefault(context);
- LocalNotificationManager localNotificationManager = new LocalNotificationManager(storage, null, context, config);
-
- localNotificationManager.schedule(null, notifications);
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationSchedule.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationSchedule.java
deleted file mode 100644
index 185ee54c7..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationSchedule.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.text.format.DateUtils;
-import com.getcapacitor.JSObject;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-public class LocalNotificationSchedule {
-
- public static String JS_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
-
- private Date at;
- private Boolean repeats;
- private String every;
- private Integer count;
-
- private DateMatch on;
-
- private Boolean whileIdle;
-
- private JSObject scheduleObj;
-
- public LocalNotificationSchedule(JSObject schedule) throws ParseException {
- this.scheduleObj = schedule;
- // Every specific unit of time (always constant)
- buildEveryElement(schedule);
- // Count of units of time from every to repeat on
- buildCountElement(schedule);
- // At specific moment of time (with repeating option)
- buildAtElement(schedule);
- // Build on - recurring times. For e.g. every 1st day of the month at 8:30.
- buildOnElement(schedule);
-
- // Schedule this notification to fire even if app is idled (Doze)
- this.whileIdle = schedule.getBoolean("allowWhileIdle", false);
- }
-
- public LocalNotificationSchedule() {}
-
- private void buildEveryElement(JSObject schedule) {
- // 'year'|'month'|'two-weeks'|'week'|'day'|'hour'|'minute'|'second';
- this.every = schedule.getString("every");
- }
-
- private void buildCountElement(JSObject schedule) {
- this.count = schedule.getInteger("count", 1);
- }
-
- private void buildAtElement(JSObject schedule) throws ParseException {
- this.repeats = schedule.getBool("repeats");
- String dateString = schedule.getString("at");
- if (dateString != null) {
- SimpleDateFormat sdf = new SimpleDateFormat(JS_DATE_FORMAT);
- sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
- this.at = sdf.parse(dateString);
- }
- }
-
- private void buildOnElement(JSObject schedule) {
- JSObject onJson = schedule.getJSObject("on");
- if (onJson != null) {
- this.on = new DateMatch();
- on.setYear(onJson.getInteger("year"));
- on.setMonth(onJson.getInteger("month"));
- on.setDay(onJson.getInteger("day"));
- on.setWeekday(onJson.getInteger("weekday"));
- on.setHour(onJson.getInteger("hour"));
- on.setMinute(onJson.getInteger("minute"));
- on.setSecond(onJson.getInteger("second"));
- }
- }
-
- public DateMatch getOn() {
- return on;
- }
-
- public JSObject getOnObj() {
- return this.scheduleObj.getJSObject("on");
- }
-
- public void setOn(DateMatch on) {
- this.on = on;
- }
-
- public Date getAt() {
- return at;
- }
-
- public void setAt(Date at) {
- this.at = at;
- }
-
- public Boolean getRepeats() {
- return repeats;
- }
-
- public void setRepeats(Boolean repeats) {
- this.repeats = repeats;
- }
-
- public String getEvery() {
- return every;
- }
-
- public void setEvery(String every) {
- this.every = every;
- }
-
- public int getCount() {
- return count;
- }
-
- public void setCount(int count) {
- this.count = count;
- }
-
- public boolean allowWhileIdle() {
- return this.whileIdle;
- }
-
- public boolean isRepeating() {
- return Boolean.TRUE.equals(this.repeats);
- }
-
- public boolean isRemovable() {
- if (every == null && on == null) {
- if (at != null) {
- return !isRepeating();
- } else {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Get constant long value representing specific interval of time (weeks, days etc.)
- */
- public Long getEveryInterval() {
- switch (every) {
- case "year":
- // This case is just approximation as not all years have the same number of days
- return count * DateUtils.WEEK_IN_MILLIS * 52;
- case "month":
- // This case is just approximation as months have different number of days
- return count * 30 * DateUtils.DAY_IN_MILLIS;
- case "two-weeks":
- return count * 2 * DateUtils.WEEK_IN_MILLIS;
- case "week":
- return count * DateUtils.WEEK_IN_MILLIS;
- case "day":
- return count * DateUtils.DAY_IN_MILLIS;
- case "hour":
- return count * DateUtils.HOUR_IN_MILLIS;
- case "minute":
- return count * DateUtils.MINUTE_IN_MILLIS;
- case "second":
- return count * DateUtils.SECOND_IN_MILLIS;
- default:
- return null;
- }
- }
-
- /**
- * Get next trigger time based on calendar and current time
- *
- * @param currentTime - current time that will be used to calculate next trigger
- * @return millisecond trigger
- */
- public Long getNextOnSchedule(Date currentTime) {
- return this.on.nextTrigger(currentTime);
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java
deleted file mode 100644
index f7697b4bb..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java
+++ /dev/null
@@ -1,301 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import static android.provider.Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM;
-
-import android.Manifest;
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Build;
-import android.service.notification.StatusBarNotification;
-import androidx.activity.result.ActivityResult;
-import com.getcapacitor.Bridge;
-import com.getcapacitor.JSArray;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.PermissionState;
-import com.getcapacitor.Plugin;
-import com.getcapacitor.PluginCall;
-import com.getcapacitor.PluginHandle;
-import com.getcapacitor.PluginMethod;
-import com.getcapacitor.annotation.ActivityCallback;
-import com.getcapacitor.annotation.CapacitorPlugin;
-import com.getcapacitor.annotation.Permission;
-import com.getcapacitor.annotation.PermissionCallback;
-import java.util.List;
-import java.util.Map;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@CapacitorPlugin(
- name = "LocalNotifications",
- permissions = @Permission(strings = { Manifest.permission.POST_NOTIFICATIONS }, alias = LocalNotificationsPlugin.LOCAL_NOTIFICATIONS)
-)
-public class LocalNotificationsPlugin extends Plugin {
-
- static final String LOCAL_NOTIFICATIONS = "display";
-
- private static Bridge staticBridge = null;
- private LocalNotificationManager manager;
- public NotificationManager notificationManager;
- private NotificationStorage notificationStorage;
- private NotificationChannelManager notificationChannelManager;
-
- @Override
- public void load() {
- super.load();
- notificationStorage = new NotificationStorage(getContext());
- manager = new LocalNotificationManager(notificationStorage, getActivity(), getContext(), this.bridge.getConfig());
- manager.createNotificationChannel();
- notificationChannelManager = new NotificationChannelManager(getActivity());
- notificationManager = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
- staticBridge = this.bridge;
- }
-
- @Override
- protected void handleOnNewIntent(Intent data) {
- super.handleOnNewIntent(data);
- if (!Intent.ACTION_MAIN.equals(data.getAction())) {
- return;
- }
- JSObject dataJson = manager.handleNotificationActionPerformed(data, notificationStorage);
- if (dataJson != null) {
- notifyListeners("localNotificationActionPerformed", dataJson, true);
- }
- }
-
- /**
- * Schedule a notification call from JavaScript
- * Creates local notification in system.
- */
- @PluginMethod
- public void schedule(PluginCall call) {
- List localNotifications = LocalNotification.buildNotificationList(call);
- if (localNotifications == null) {
- return;
- }
- JSONArray ids = manager.schedule(call, localNotifications);
- if (ids != null) {
- notificationStorage.appendNotifications(localNotifications);
- JSObject result = new JSObject();
- JSArray jsArray = new JSArray();
- for (int i = 0; i < ids.length(); i++) {
- try {
- JSObject notification = new JSObject().put("id", ids.getInt(i));
- jsArray.put(notification);
- } catch (Exception ex) {}
- }
- result.put("notifications", jsArray);
- call.resolve(result);
- }
- }
-
- @PluginMethod
- public void cancel(PluginCall call) {
- manager.cancel(call);
- }
-
- @PluginMethod
- public void getPending(PluginCall call) {
- List notifications = notificationStorage.getSavedNotifications();
- JSObject result = LocalNotification.buildLocalNotificationPendingList(notifications);
- call.resolve(result);
- }
-
- @PluginMethod
- public void registerActionTypes(PluginCall call) {
- JSArray types = call.getArray("types");
- Map typesArray = NotificationAction.buildTypes(types);
- notificationStorage.writeActionGroup(typesArray);
- call.resolve();
- }
-
- @PluginMethod
- public void areEnabled(PluginCall call) {
- JSObject data = new JSObject();
- data.put("value", manager.areNotificationsEnabled());
- call.resolve(data);
- }
-
- @PluginMethod
- @SuppressWarnings("deprecation")
- public void getDeliveredNotifications(PluginCall call) {
- JSArray notifications = new JSArray();
- StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
-
- for (StatusBarNotification notif : activeNotifications) {
- JSObject jsNotif = new JSObject();
-
- jsNotif.put("id", notif.getId());
- jsNotif.put("tag", notif.getTag());
-
- Notification notification = notif.getNotification();
- if (notification != null) {
- jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
- jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
- jsNotif.put("group", notification.getGroup());
- jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));
-
- JSObject extras = new JSObject();
-
- for (String key : notification.extras.keySet()) {
- extras.put(key, notification.extras.get(key));
- }
-
- jsNotif.put("data", extras);
- }
-
- notifications.put(jsNotif);
- }
-
- JSObject result = new JSObject();
- result.put("notifications", notifications);
- call.resolve(result);
- }
-
- @PluginMethod
- public void removeDeliveredNotifications(PluginCall call) {
- JSArray notifications = call.getArray("notifications");
-
- try {
- for (Object o : notifications.toList()) {
- if (o instanceof JSONObject) {
- JSObject notif = JSObject.fromJSONObject((JSONObject) o);
- String tag = notif.getString("tag");
- Integer id = notif.getInteger("id");
-
- if (tag == null) {
- notificationManager.cancel(id);
- } else {
- notificationManager.cancel(tag, id);
- }
- } else {
- call.reject("Expected notifications to be a list of notification objects");
- }
- }
- } catch (JSONException e) {
- call.reject(e.getMessage());
- }
-
- call.resolve();
- }
-
- @PluginMethod
- public void removeAllDeliveredNotifications(PluginCall call) {
- notificationManager.cancelAll();
- call.resolve();
- }
-
- @PluginMethod
- public void createChannel(PluginCall call) {
- notificationChannelManager.createChannel(call);
- }
-
- @PluginMethod
- public void deleteChannel(PluginCall call) {
- notificationChannelManager.deleteChannel(call);
- }
-
- @PluginMethod
- public void listChannels(PluginCall call) {
- notificationChannelManager.listChannels(call);
- }
-
- @PluginMethod
- public void checkPermissions(PluginCall call) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
- JSObject permissionsResultJSON = new JSObject();
- permissionsResultJSON.put("display", getNotificationPermissionText());
- call.resolve(permissionsResultJSON);
- } else {
- super.checkPermissions(call);
- }
- }
-
- @PluginMethod
- public void requestPermissions(PluginCall call) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || getPermissionState(LOCAL_NOTIFICATIONS) == PermissionState.GRANTED) {
- JSObject permissionsResultJSON = new JSObject();
- permissionsResultJSON.put("display", getNotificationPermissionText());
- call.resolve(permissionsResultJSON);
- } else {
- requestPermissionForAlias(LOCAL_NOTIFICATIONS, call, "permissionsCallback");
- }
- }
-
- @PluginMethod
- public void changeExactNotificationSetting(PluginCall call) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- startActivityForResult(
- call,
- new Intent(ACTION_REQUEST_SCHEDULE_EXACT_ALARM, Uri.parse("package:" + getActivity().getPackageName())),
- "alarmPermissionsCallback"
- );
- } else {
- checkExactNotificationSetting(call);
- }
- }
-
- @PluginMethod
- public void checkExactNotificationSetting(PluginCall call) {
- JSObject permissionsResultJSON = new JSObject();
- permissionsResultJSON.put("exact_alarm", getExactAlarmPermissionText());
-
- call.resolve(permissionsResultJSON);
- }
-
- @PermissionCallback
- private void permissionsCallback(PluginCall call) {
- JSObject permissionsResultJSON = new JSObject();
- permissionsResultJSON.put("display", getNotificationPermissionText());
-
- call.resolve(permissionsResultJSON);
- }
-
- @ActivityCallback
- private void alarmPermissionsCallback(PluginCall call, ActivityResult result) {
- checkExactNotificationSetting(call);
- }
-
- private String getNotificationPermissionText() {
- if (manager.areNotificationsEnabled()) {
- return "granted";
- } else {
- return "denied";
- }
- }
-
- private String getExactAlarmPermissionText() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE);
- if (alarmManager.canScheduleExactAlarms()) {
- return "granted";
- } else {
- return "denied";
- }
- }
-
- return "granted";
- }
-
- public static void fireReceived(JSObject notification) {
- LocalNotificationsPlugin localNotificationsPlugin = LocalNotificationsPlugin.getLocalNotificationsInstance();
- if (localNotificationsPlugin != null) {
- localNotificationsPlugin.notifyListeners("localNotificationReceived", notification, true);
- }
- }
-
- public static LocalNotificationsPlugin getLocalNotificationsInstance() {
- if (staticBridge != null && staticBridge.getWebView() != null) {
- PluginHandle handle = staticBridge.getPlugin("LocalNotifications");
- if (handle == null) {
- return null;
- }
- return (LocalNotificationsPlugin) handle.getInstance();
- }
- return null;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationAction.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationAction.java
deleted file mode 100644
index d4bc88fa5..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import com.getcapacitor.JSArray;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.Logger;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-/**
- * Action types that will be registered for the notifications
- */
-public class NotificationAction {
-
- private String id;
- private String title;
- private Boolean input;
-
- public NotificationAction() {}
-
- public NotificationAction(String id, String title, Boolean input) {
- this.id = id;
- this.title = title;
- this.input = input;
- }
-
- public static Map buildTypes(JSArray types) {
- Map actionTypeMap = new HashMap<>();
- try {
- List objects = types.toList();
- for (JSONObject obj : objects) {
- JSObject jsObject = JSObject.fromJSONObject(obj);
- String actionGroupId = jsObject.getString("id");
- if (actionGroupId == null) {
- return null;
- }
- JSONArray actions = jsObject.getJSONArray("actions");
- if (actions != null) {
- NotificationAction[] typesArray = new NotificationAction[actions.length()];
- for (int i = 0; i < typesArray.length; i++) {
- NotificationAction notificationAction = new NotificationAction();
- JSObject action = JSObject.fromJSONObject(actions.getJSONObject(i));
- notificationAction.setId(action.getString("id"));
- notificationAction.setTitle(action.getString("title"));
- notificationAction.setInput(action.getBool("input"));
- typesArray[i] = notificationAction;
- }
- actionTypeMap.put(actionGroupId, typesArray);
- }
- }
- } catch (Exception e) {
- Logger.error(Logger.tags("LN"), "Error when building action types", e);
- }
- return actionTypeMap;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public boolean isInput() {
- return Boolean.TRUE.equals(input);
- }
-
- public void setInput(Boolean input) {
- this.input = input;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationChannelManager.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationChannelManager.java
deleted file mode 100644
index 6dea48c42..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationChannelManager.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.graphics.Color;
-import android.media.AudioAttributes;
-import android.net.Uri;
-import androidx.core.app.NotificationCompat;
-import com.getcapacitor.JSArray;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.Logger;
-import com.getcapacitor.PluginCall;
-import java.util.List;
-
-public class NotificationChannelManager {
-
- private Context context;
- private NotificationManager notificationManager;
-
- public NotificationChannelManager(Context context) {
- this.context = context;
- this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
- }
-
- public NotificationChannelManager(Context context, NotificationManager manager) {
- this.context = context;
- this.notificationManager = manager;
- }
-
- private static String CHANNEL_ID = "id";
- private static String CHANNEL_NAME = "name";
- private static String CHANNEL_DESCRIPTION = "description";
- private static String CHANNEL_IMPORTANCE = "importance";
- private static String CHANNEL_VISIBILITY = "visibility";
- private static String CHANNEL_SOUND = "sound";
- private static String CHANNEL_VIBRATE = "vibration";
- private static String CHANNEL_USE_LIGHTS = "lights";
- private static String CHANNEL_LIGHT_COLOR = "lightColor";
-
- public void createChannel(PluginCall call) {
- JSObject channel = new JSObject();
- if (call.getString(CHANNEL_ID) != null) {
- channel.put(CHANNEL_ID, call.getString(CHANNEL_ID));
- } else {
- call.reject("Channel missing identifier");
- return;
- }
- if (call.getString(CHANNEL_NAME) != null) {
- channel.put(CHANNEL_NAME, call.getString(CHANNEL_NAME));
- } else {
- call.reject("Channel missing name");
- return;
- }
-
- channel.put(CHANNEL_IMPORTANCE, call.getInt(CHANNEL_IMPORTANCE, NotificationManager.IMPORTANCE_DEFAULT));
- channel.put(CHANNEL_DESCRIPTION, call.getString(CHANNEL_DESCRIPTION, ""));
- channel.put(CHANNEL_VISIBILITY, call.getInt(CHANNEL_VISIBILITY, NotificationCompat.VISIBILITY_PUBLIC));
- channel.put(CHANNEL_SOUND, call.getString(CHANNEL_SOUND, null));
- channel.put(CHANNEL_VIBRATE, call.getBoolean(CHANNEL_VIBRATE, false));
- channel.put(CHANNEL_USE_LIGHTS, call.getBoolean(CHANNEL_USE_LIGHTS, false));
- channel.put(CHANNEL_LIGHT_COLOR, call.getString(CHANNEL_LIGHT_COLOR, null));
- createChannel(channel);
- call.resolve();
- }
-
- public void createChannel(JSObject channel) {
- NotificationChannel notificationChannel = new NotificationChannel(
- channel.getString(CHANNEL_ID),
- channel.getString(CHANNEL_NAME),
- channel.getInteger(CHANNEL_IMPORTANCE)
- );
- notificationChannel.setDescription(channel.getString(CHANNEL_DESCRIPTION));
- notificationChannel.setLockscreenVisibility(channel.getInteger(CHANNEL_VISIBILITY));
- notificationChannel.enableVibration(channel.getBool(CHANNEL_VIBRATE));
- notificationChannel.enableLights(channel.getBool(CHANNEL_USE_LIGHTS));
- String lightColor = channel.getString(CHANNEL_LIGHT_COLOR);
- if (lightColor != null) {
- try {
- notificationChannel.setLightColor(Color.parseColor(lightColor));
- } catch (IllegalArgumentException ex) {
- Logger.error(Logger.tags("NotificationChannel"), "Invalid color provided for light color.", null);
- }
- }
- String sound = channel.getString(CHANNEL_SOUND, null);
- if (sound != null && !sound.isEmpty()) {
- if (sound.contains(".")) {
- sound = sound.substring(0, sound.lastIndexOf('.'));
- }
- AudioAttributes audioAttributes = new AudioAttributes.Builder()
- .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
- .setUsage(AudioAttributes.USAGE_NOTIFICATION)
- .build();
- Uri soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/raw/" + sound);
- notificationChannel.setSound(soundUri, audioAttributes);
- }
- notificationManager.createNotificationChannel(notificationChannel);
- }
-
- public void deleteChannel(PluginCall call) {
- String channelId = call.getString("id");
- notificationManager.deleteNotificationChannel(channelId);
- call.resolve();
- }
-
- public void listChannels(PluginCall call) {
- List notificationChannels = notificationManager.getNotificationChannels();
- JSArray channels = new JSArray();
- for (NotificationChannel notificationChannel : notificationChannels) {
- JSObject channel = new JSObject();
- channel.put(CHANNEL_ID, notificationChannel.getId());
- channel.put(CHANNEL_NAME, notificationChannel.getName());
- channel.put(CHANNEL_DESCRIPTION, notificationChannel.getDescription());
- channel.put(CHANNEL_IMPORTANCE, notificationChannel.getImportance());
- channel.put(CHANNEL_VISIBILITY, notificationChannel.getLockscreenVisibility());
- channel.put(CHANNEL_SOUND, notificationChannel.getSound());
- channel.put(CHANNEL_VIBRATE, notificationChannel.shouldVibrate());
- channel.put(CHANNEL_USE_LIGHTS, notificationChannel.shouldShowLights());
- channel.put(CHANNEL_LIGHT_COLOR, String.format("#%06X", 0xFFFFFF & notificationChannel.getLightColor()));
- Logger.debug(Logger.tags("NotificationChannel"), "visibility " + notificationChannel.getLockscreenVisibility());
- Logger.debug(Logger.tags("NotificationChannel"), "importance " + notificationChannel.getImportance());
- channels.put(channel);
- }
- JSObject result = new JSObject();
- result.put("channels", channels);
- call.resolve(result);
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationDismissReceiver.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationDismissReceiver.java
deleted file mode 100644
index c29cbb19a..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationDismissReceiver.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import com.getcapacitor.Logger;
-
-/**
- * Receiver called when notification is dismissed by user
- */
-public class NotificationDismissReceiver extends BroadcastReceiver {
-
- @Override
- public void onReceive(Context context, Intent intent) {
- int intExtra = intent.getIntExtra(LocalNotificationManager.NOTIFICATION_INTENT_KEY, Integer.MIN_VALUE);
- if (intExtra == Integer.MIN_VALUE) {
- Logger.error(Logger.tags("LN"), "Invalid notification dismiss operation", null);
- return;
- }
- boolean isRemovable = intent.getBooleanExtra(LocalNotificationManager.NOTIFICATION_IS_REMOVABLE_KEY, true);
- if (isRemovable) {
- NotificationStorage notificationStorage = new NotificationStorage(context);
- notificationStorage.deleteNotification(Integer.toString(intExtra));
- }
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationStorage.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationStorage.java
deleted file mode 100644
index 74ab38faf..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/NotificationStorage.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import com.getcapacitor.JSObject;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.json.JSONException;
-
-/**
- * Class used to abstract storage for notification data
- */
-public class NotificationStorage {
-
- // Key for private preferences
- private static final String NOTIFICATION_STORE_ID = "NOTIFICATION_STORE";
-
- // Key used to save action types
- private static final String ACTION_TYPES_ID = "ACTION_TYPE_STORE";
-
- private static final String ID_KEY = "notificationIds";
-
- private Context context;
-
- public NotificationStorage(Context context) {
- this.context = context;
- }
-
- /**
- * Persist the id of currently scheduled notification
- */
- public void appendNotifications(List localNotifications) {
- SharedPreferences storage = getStorage(NOTIFICATION_STORE_ID);
- SharedPreferences.Editor editor = storage.edit();
- for (LocalNotification request : localNotifications) {
- if (request.isScheduled()) {
- String key = request.getId().toString();
- editor.putString(key, request.getSource());
- }
- }
- editor.apply();
- }
-
- public List getSavedNotificationIds() {
- SharedPreferences storage = getStorage(NOTIFICATION_STORE_ID);
- Map all = storage.getAll();
- if (all != null) {
- return new ArrayList<>(all.keySet());
- }
- return new ArrayList<>();
- }
-
- public List getSavedNotifications() {
- SharedPreferences storage = getStorage(NOTIFICATION_STORE_ID);
- Map all = storage.getAll();
- if (all != null) {
- ArrayList notifications = new ArrayList<>();
- for (String key : all.keySet()) {
- String notificationString = (String) all.get(key);
- JSObject jsNotification = getNotificationFromJSONString(notificationString);
- if (jsNotification != null) {
- try {
- LocalNotification notification = LocalNotification.buildNotificationFromJSObject(jsNotification);
- notifications.add(notification);
- } catch (ParseException ex) {}
- }
- }
-
- return notifications;
- }
-
- return new ArrayList<>();
- }
-
- public JSObject getNotificationFromJSONString(String notificationString) {
- if (notificationString == null) {
- return null;
- }
-
- JSObject jsNotification;
- try {
- jsNotification = new JSObject(notificationString);
- } catch (JSONException ex) {
- return null;
- }
-
- return jsNotification;
- }
-
- public JSObject getSavedNotificationAsJSObject(String key) {
- SharedPreferences storage = getStorage(NOTIFICATION_STORE_ID);
- String notificationString;
- try {
- notificationString = storage.getString(key, null);
- } catch (ClassCastException ex) {
- return null;
- }
-
- if (notificationString == null) {
- return null;
- }
-
- JSObject jsNotification;
- try {
- jsNotification = new JSObject(notificationString);
- } catch (JSONException ex) {
- return null;
- }
-
- return jsNotification;
- }
-
- public LocalNotification getSavedNotification(String key) {
- JSObject jsNotification = getSavedNotificationAsJSObject(key);
- if (jsNotification == null) {
- return null;
- }
-
- LocalNotification notification;
- try {
- notification = LocalNotification.buildNotificationFromJSObject(jsNotification);
- } catch (ParseException ex) {
- return null;
- }
-
- return notification;
- }
-
- /**
- * Remove the stored notifications
- */
- public void deleteNotification(String id) {
- SharedPreferences.Editor editor = getStorage(NOTIFICATION_STORE_ID).edit();
- editor.remove(id);
- editor.apply();
- }
-
- /**
- * Shared private preferences for the application.
- */
- private SharedPreferences getStorage(String key) {
- return context.getSharedPreferences(key, Context.MODE_PRIVATE);
- }
-
- /**
- * Writes new action types (actions that being displayed in notification) to storage.
- * Write will override previous data.
- *
- * @param typesMap - map with groupId and actionArray assigned to group
- */
- public void writeActionGroup(Map typesMap) {
- Set typesIds = typesMap.keySet();
- for (String id : typesIds) {
- SharedPreferences.Editor editor = getStorage(ACTION_TYPES_ID + id).edit();
- editor.clear();
- NotificationAction[] notificationActions = typesMap.get(id);
- editor.putInt("count", notificationActions.length);
- for (int i = 0; i < notificationActions.length; i++) {
- editor.putString("id" + i, notificationActions[i].getId());
- editor.putString("title" + i, notificationActions[i].getTitle());
- editor.putBoolean("input" + i, notificationActions[i].isInput());
- }
- editor.apply();
- }
- }
-
- /**
- * Retrieve array of notification actions per ActionTypeId
- *
- * @param forId - id of the group
- */
- public NotificationAction[] getActionGroup(String forId) {
- SharedPreferences storage = getStorage(ACTION_TYPES_ID + forId);
- int count = storage.getInt("count", 0);
- NotificationAction[] actions = new NotificationAction[count];
- for (int i = 0; i < count; i++) {
- String id = storage.getString("id" + i, "");
- String title = storage.getString("title" + i, "");
- Boolean input = storage.getBoolean("input" + i, false);
- actions[i] = new NotificationAction(id, title, input);
- }
- return actions;
- }
-}
diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/TimedNotificationPublisher.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/TimedNotificationPublisher.java
deleted file mode 100644
index 0a5c0add0..000000000
--- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/TimedNotificationPublisher.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.capacitorjs.plugins.localnotifications;
-
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import com.getcapacitor.JSObject;
-import com.getcapacitor.Logger;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Class used to create notification from timer event
- * Note: Class is being registered in Android manifest as broadcast receiver
- */
-public class TimedNotificationPublisher extends BroadcastReceiver {
-
- public static String NOTIFICATION_KEY = "NotificationPublisher.notification";
- public static String CRON_KEY = "NotificationPublisher.cron";
-
- /**
- * Restore and present notification
- */
- @Override
- public void onReceive(Context context, Intent intent) {
- NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
-
- Notification notification;
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
- notification = intent.getParcelableExtra(NOTIFICATION_KEY, Notification.class);
- } else {
- notification = getParcelableExtraLegacy(intent, NOTIFICATION_KEY);
- }
-
- notification.when = System.currentTimeMillis();
-
- int id = intent.getIntExtra(LocalNotificationManager.NOTIFICATION_INTENT_KEY, Integer.MIN_VALUE);
- if (id == Integer.MIN_VALUE) {
- Logger.error(Logger.tags("LN"), "No valid id supplied", null);
- }
- NotificationStorage storage = new NotificationStorage(context);
- JSObject notificationJson = storage.getSavedNotificationAsJSObject(Integer.toString(id));
- LocalNotificationsPlugin.fireReceived(notificationJson);
- notificationManager.notify(id, notification);
- if (!rescheduleNotificationIfNeeded(context, intent, id)) {
- storage.deleteNotification(Integer.toString(id));
- }
- }
-
- @SuppressWarnings("deprecation")
- private Notification getParcelableExtraLegacy(Intent intent, String string) {
- return intent.getParcelableExtra(NOTIFICATION_KEY);
- }
-
- private boolean rescheduleNotificationIfNeeded(Context context, Intent intent, int id) {
- String dateString = intent.getStringExtra(CRON_KEY);
-
- if (dateString != null) {
- DateMatch date = DateMatch.fromMatchString(dateString);
- AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
-
- long trigger = date.nextTrigger(new Date());
- Intent clone = (Intent) intent.clone();
- int flags = PendingIntent.FLAG_CANCEL_CURRENT;
- if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
- flags = flags | PendingIntent.FLAG_MUTABLE;
- }
- PendingIntent pendingIntent = PendingIntent.getBroadcast(context, id, clone, flags);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !alarmManager.canScheduleExactAlarms()) {
- Logger.warn(
- "Capacitor/LocalNotification",
- "Exact alarms not allowed in user settings. Notification scheduled with non-exact alarm."
- );
- alarmManager.set(AlarmManager.RTC, trigger, pendingIntent);
- } else {
- alarmManager.setExact(AlarmManager.RTC, trigger, pendingIntent);
- }
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
- Logger.debug(Logger.tags("LN"), "notification " + id + " will next fire at " + sdf.format(new Date(trigger)));
- return true;
- }
-
- return false;
- }
-}
diff --git a/local-notifications/android/src/main/res/drawable/ic_transparent.xml b/local-notifications/android/src/main/res/drawable/ic_transparent.xml
deleted file mode 100644
index fc1779e2b..000000000
--- a/local-notifications/android/src/main/res/drawable/ic_transparent.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/local-notifications/android/src/test/java/com/getcapacitor/ExampleUnitTest.java b/local-notifications/android/src/test/java/com/getcapacitor/ExampleUnitTest.java
deleted file mode 100644
index a0fed0cfb..000000000
--- a/local-notifications/android/src/test/java/com/getcapacitor/ExampleUnitTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.getcapacitor;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see Testing documentation
- */
-public class ExampleUnitTest {
-
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
diff --git a/local-notifications/ios/.gitignore b/local-notifications/ios/.gitignore
deleted file mode 100644
index 0023a5340..000000000
--- a/local-notifications/ios/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.DS_Store
-/.build
-/Packages
-xcuserdata/
-DerivedData/
-.swiftpm/configuration/registries.json
-.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
-.netrc
diff --git a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsHandler.swift b/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsHandler.swift
deleted file mode 100644
index efe2bae6a..000000000
--- a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsHandler.swift
+++ /dev/null
@@ -1,141 +0,0 @@
-import Capacitor
-import UserNotifications
-
-public class LocalNotificationsHandler: NSObject, NotificationHandlerProtocol {
-
- public weak var plugin: CAPPlugin?
-
- // Local list of notification id -> JSObject for storing options
- // between notification requets
- var notificationRequestLookup = [String: JSObject]()
-
- public func requestPermissions(with completion: ((Bool, Error?) -> Void)? = nil) {
- let center = UNUserNotificationCenter.current()
- center.requestAuthorization(options: [.badge, .alert, .sound]) { (granted, error) in
- completion?(granted, error)
- }
- }
-
- public func checkPermissions(with completion: ((UNAuthorizationStatus) -> Void)? = nil) {
- let center = UNUserNotificationCenter.current()
- center.getNotificationSettings { settings in
- completion?(settings.authorizationStatus)
- }
- }
-
- public func willPresent(notification: UNNotification) -> UNNotificationPresentationOptions {
- let notificationData = makeNotificationRequestJSObject(notification.request)
-
- self.plugin?.notifyListeners("localNotificationReceived", data: notificationData)
-
- if let options = notificationRequestLookup[notification.request.identifier] {
- let silent = options["silent"] as? Bool ?? false
- if silent {
- return UNNotificationPresentationOptions.init(rawValue: 0)
- }
- }
-
- if let optionsArray = self.plugin?.getConfig().getArray("presentationOptions") as? [String] {
- var presentationOptions = UNNotificationPresentationOptions.init()
-
- optionsArray.forEach { option in
- switch option {
- case "banner":
- presentationOptions.insert(.banner)
- case "list":
- presentationOptions.insert(.list)
- case "badge":
- presentationOptions.insert(.badge)
- case "sound":
- presentationOptions.insert(.sound)
- default:
- print("Unrecognized presentation option: \(option)")
- }
- }
-
- return presentationOptions
- }
-
- return [
- .badge,
- .sound,
- .banner,
- .list
- ]
- }
-
- public func didReceive(response: UNNotificationResponse) {
- var data = JSObject()
-
- // Get the info for the original notification request
- let originalNotificationRequest = response.notification.request
-
- let actionId = response.actionIdentifier
-
- // We turn the two default actions (open/dismiss) into generic strings
- if actionId == UNNotificationDefaultActionIdentifier {
- data["actionId"] = "tap"
- } else if actionId == UNNotificationDismissActionIdentifier {
- data["actionId"] = "dismiss"
- } else {
- data["actionId"] = actionId
- }
-
- // If the type of action was for an input type, get the value
- if let inputType = response as? UNTextInputNotificationResponse {
- data["inputValue"] = inputType.userText
- }
-
- data["notification"] = makeNotificationRequestJSObject(originalNotificationRequest)
-
- self.plugin?.notifyListeners("localNotificationActionPerformed", data: data, retainUntilConsumed: true)
- }
-
- /**
- * Turn a UNNotificationRequest into a JSObject to return back to the client.
- */
- func makeNotificationRequestJSObject(_ request: UNNotificationRequest) -> JSObject {
- let notificationRequest = notificationRequestLookup[request.identifier] ?? [:]
- var notification = makePendingNotificationRequestJSObject(request)
- notification["sound"] = notificationRequest["sound"] ?? ""
- notification["actionTypeId"] = request.content.categoryIdentifier
- notification["attachments"] = notificationRequest["attachments"] ?? []
- return notification
-
- }
-
- func makePendingNotificationRequestJSObject(_ request: UNNotificationRequest) -> JSObject {
- var notification: JSObject = [
- "id": Int(request.identifier) ?? -1,
- "title": request.content.title,
- "body": request.content.body
- ]
-
- if let userInfo = JSTypes.coerceDictionaryToJSObject(request.content.userInfo) {
- var extra = userInfo["cap_extra"] as? JSObject ?? userInfo
-
- // check for any dates and convert them to strings
- for(key, value) in extra {
- if let date = value as? Date {
- let dateString = ISO8601DateFormatter().string(from: date)
- extra[key] = dateString
- }
- }
-
- notification["extra"] = extra
-
- if var schedule = userInfo["cap_schedule"] as? JSObject {
- // convert schedule at date to string
- if let date = schedule["at"] as? Date {
- let dateString = ISO8601DateFormatter().string(from: date)
- schedule["at"] = dateString
- }
-
- notification["schedule"] = schedule
- }
- }
-
- return notification
-
- }
-}
diff --git a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift b/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift
deleted file mode 100644
index 55de6c591..000000000
--- a/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swift
+++ /dev/null
@@ -1,645 +0,0 @@
-import Foundation
-import Capacitor
-import UserNotifications
-
-enum LocalNotificationError: LocalizedError {
- case contentNoId
- case contentNoTitle
- case contentNoBody
- case triggerConstructionFailed
- case triggerRepeatIntervalTooShort
- case attachmentNoId
- case attachmentNoUrl
- case attachmentFileNotFound(path: String)
- case attachmentUnableToCreate(String)
-
- var errorDescription: String? {
- switch self {
- case .attachmentFileNotFound(path: let path):
- return "Unable to find file \(path) for attachment"
- default:
- return ""
- }
- }
-}
-
-// swiftlint:disable type_body_length
-@objc(LocalNotificationsPlugin)
-public class LocalNotificationsPlugin: CAPPlugin, CAPBridgedPlugin {
- public let identifier = "LocalNotificationsPlugin"
- public let jsName = "LocalNotifications"
- public let pluginMethods: [CAPPluginMethod] = [
- CAPPluginMethod(name: "schedule", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "checkExactNotificationSetting", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "changeExactNotificationSetting", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "cancel", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "getPending", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "registerActionTypes", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "areEnabled", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "getDeliveredNotifications", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "removeAllDeliveredNotifications", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "removeDeliveredNotifications", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "createChannel", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "deleteChannel", returnType: CAPPluginReturnPromise),
- CAPPluginMethod(name: "listChannels", returnType: CAPPluginReturnPromise)
- ]
- private let notificationDelegationHandler = LocalNotificationsHandler()
-
- override public func load() {
- self.bridge?.notificationRouter.localNotificationHandler = self.notificationDelegationHandler
- self.notificationDelegationHandler.plugin = self
- self.shouldStringifyDatesInCalls = false
- }
-
- /**
- * Schedule a notification.
- */
- @objc func schedule(_ call: CAPPluginCall) {
- guard let notifications = call.getArray("notifications", JSObject.self) else {
- call.reject("Must provide notifications array as notifications option")
- return
- }
- var ids = [String]()
-
- for notification in notifications {
- guard let identifier = notification["id"] as? Int else {
- call.reject("Notification missing identifier")
- return
- }
-
- // let extra = notification["options"] as? JSObject ?? [:]
-
- var content: UNNotificationContent
- do {
- content = try makeNotificationContent(notification)
- } catch {
- CAPLog.print(error.localizedDescription)
- call.reject("Unable to make notification", nil, error)
- return
- }
-
- var trigger: UNNotificationTrigger?
-
- do {
- if let schedule = notification["schedule"] as? JSObject {
- try trigger = handleScheduledNotification(call, schedule)
- }
- } catch {
- call.reject("Unable to create notification, trigger failed", nil, error)
- return
- }
-
- // Schedule the request.
- let request = UNNotificationRequest(identifier: "\(identifier)", content: content, trigger: trigger)
-
- self.notificationDelegationHandler.notificationRequestLookup[request.identifier] = notification
-
- let center = UNUserNotificationCenter.current()
- center.add(request) { (error: Error?) in
- if let theError = error {
- CAPLog.print(theError.localizedDescription)
- call.reject(theError.localizedDescription)
- }
- }
-
- ids.append(request.identifier)
- }
-
- let ret = ids.map({ (id) -> JSObject in
- return [
- "id": Int(id) ?? -1
- ]
- })
- call.resolve([
- "notifications": ret
- ])
- }
-
- /**
- * Request notification permission
- */
- @objc override public func requestPermissions(_ call: CAPPluginCall) {
- self.notificationDelegationHandler.requestPermissions { granted, error in
- guard error == nil else {
- call.reject(error!.localizedDescription)
- return
- }
- call.resolve(["display": granted ? "granted" : "denied"])
- }
- }
-
- @objc override public func checkPermissions(_ call: CAPPluginCall) {
- self.notificationDelegationHandler.checkPermissions { status in
- let permission: String
-
- switch status {
- case .authorized, .ephemeral, .provisional:
- permission = "granted"
- case .denied:
- permission = "denied"
- case .notDetermined:
- permission = "prompt"
- @unknown default:
- permission = "prompt"
- }
-
- call.resolve(["display": permission])
- }
- }
-
- @objc public func checkExactNotificationSetting(_ call: CAPPluginCall) {
- call.unimplemented()
- }
-
- @objc public func changeExactNotificationSetting(_ call: CAPPluginCall) {
- call.unimplemented()
- }
-
- /**
- * Cancel notifications by id
- */
- @objc func cancel(_ call: CAPPluginCall) {
- guard let notifications = call.getArray("notifications", JSObject.self), notifications.count > 0 else {
- call.reject("Must supply notifications to cancel")
- return
- }
-
- let ids = notifications.map({ (value: JSObject) -> String in
- if let idString = value["id"] as? String {
- return idString
- } else if let idNum = value["id"] as? NSNumber {
- return idNum.stringValue
- }
- return ""
- })
-
- UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: ids)
- call.resolve()
- }
-
- /**
- * Get all pending notifications.
- */
- @objc func getPending(_ call: CAPPluginCall) {
- UNUserNotificationCenter.current().getPendingNotificationRequests(completionHandler: { (notifications) in
- CAPLog.print("num of pending notifications \(notifications.count)")
- CAPLog.print(notifications)
-
- let ret = notifications.compactMap({ [weak self] (notification) -> JSObject? in
- return self?.notificationDelegationHandler.makePendingNotificationRequestJSObject(notification)
- })
-
- call.resolve([
- "notifications": ret
- ])
- })
- }
-
- /**
- * Register allowed action types that a notification may present.
- */
- @objc func registerActionTypes(_ call: CAPPluginCall) {
- guard let types = call.getArray("types", JSObject.self) else {
- return
- }
-
- makeActionTypes(types)
-
- call.resolve()
- }
-
- /**
- * Check if Local Notifications are authorized and enabled
- */
- @objc func areEnabled(_ call: CAPPluginCall) {
- let center = UNUserNotificationCenter.current()
- center.getNotificationSettings { (settings) in
- let authorized = settings.authorizationStatus == UNAuthorizationStatus.authorized
- let enabled = settings.notificationCenterSetting == UNNotificationSetting.enabled
- call.resolve([
- "value": enabled && authorized
- ])
- }
- }
-
- /**
- * Build the content for a notification.
- */
- func makeNotificationContent(_ notification: JSObject) throws -> UNNotificationContent {
- guard let title = notification["title"] as? String else {
- throw LocalNotificationError.contentNoTitle
- }
- guard let body = notification["body"] as? String else {
- throw LocalNotificationError.contentNoBody
- }
-
- let extra = notification["extra"] as? JSObject ?? [:]
- let schedule = notification["schedule"] as? JSObject ?? [:]
- let content = UNMutableNotificationContent()
- content.title = NSString.localizedUserNotificationString(forKey: title, arguments: nil)
- content.body = NSString.localizedUserNotificationString(forKey: body,
- arguments: nil)
-
- content.userInfo = [
- "cap_extra": extra,
- "cap_schedule": schedule
- ]
-
- if let actionTypeId = notification["actionTypeId"] as? String {
- content.categoryIdentifier = actionTypeId
- }
-
- if let threadIdentifier = notification["threadIdentifier"] as? String {
- content.threadIdentifier = threadIdentifier
- }
-
- if let relevanceScore = notification["relevanceScore"] as? Double {
- content.relevanceScore = relevanceScore
- }
-
- if let interruptionLevelString = notification["interruptionLevel"] as? String {
- switch interruptionLevelString {
- case "active":
- content.interruptionLevel = .active
- case "critical":
- content.interruptionLevel = .critical
- case "passive":
- content.interruptionLevel = .passive
- case "timeSensitive":
- content.interruptionLevel = .timeSensitive
- default:
- break
- }
- }
-
- if let sound = notification["sound"] as? String {
- content.sound = UNNotificationSound(named: UNNotificationSoundName(sound))
- }
-
- if let attachments = notification["attachments"] as? [JSObject] {
- content.attachments = try makeAttachments(attachments)
- }
-
- return content
- }
-
- /**
- * Build a notification trigger, such as triggering each N seconds, or
- * on a certain date "shape" (such as every first of the month)
- */
- func handleScheduledNotification(_ call: CAPPluginCall, _ schedule: JSObject) throws -> UNNotificationTrigger? {
- var at: Date?
- if let scheduleDate = schedule["at"] as? NSDate {
- at = scheduleDate as Date
- }
- let every = schedule["every"] as? String
- let count = schedule["count"] as? Int ?? 1
- let on = schedule["on"] as? JSObject
- let repeats = schedule["repeats"] as? Bool ?? false
-
- // If there's a specific date for this notificiation
- if let at = at {
- let dateInfo = Calendar.current.dateComponents(in: TimeZone.current, from: at)
-
- if dateInfo.date! < Date() {
- call.reject("Scheduled time must be *after* current time")
- return nil
- }
-
- let dateInterval = DateInterval(start: Date(), end: dateInfo.date!)
-
- // Notifications that repeat have to be at least a minute between each other
- if repeats && dateInterval.duration < 60 {
- throw LocalNotificationError.triggerRepeatIntervalTooShort
- }
-
- return UNTimeIntervalNotificationTrigger(timeInterval: dateInterval.duration, repeats: repeats)
- }
-
- // If this notification should repeat every count of day/month/week/etc. or on a certain
- // matching set of date components
- if let on = on {
- let dateComponents = getDateComponents(on)
- return UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
- }
-
- if let every = every {
- if let repeatDateInterval = getRepeatDateInterval(every, count) {
- return UNTimeIntervalNotificationTrigger(timeInterval: repeatDateInterval.duration, repeats: true)
- }
- }
-
- return nil
- }
-
- /**
- * Given our schedule format, return a DateComponents object
- * that only contains the components passed in.
- */
- func getDateComponents(_ at: JSObject) -> DateComponents {
- // var dateInfo = Calendar.current.dateComponents(in: TimeZone.current, from: Date())
- // dateInfo.calendar = Calendar.current
- var dateInfo = DateComponents()
-
- if let year = at["year"] as? Int {
- dateInfo.year = year
- }
- if let month = at["month"] as? Int {
- dateInfo.month = month
- }
- if let day = at["day"] as? Int {
- dateInfo.day = day
- }
- if let hour = at["hour"] as? Int {
- dateInfo.hour = hour
- }
- if let minute = at["minute"] as? Int {
- dateInfo.minute = minute
- }
- if let second = at["second"] as? Int {
- dateInfo.second = second
- }
- if let weekday = at["weekday"] as? Int {
- dateInfo.weekday = weekday
- }
- return dateInfo
- }
-
- /**
- * Compute the difference between the string representation of a date
- * interval and today. For example, if every is "month", then we
- * return the interval between today and a month from today.
- */
- func getRepeatDateInterval(_ every: String, _ count: Int) -> DateInterval? {
- let cal = Calendar.current
- let now = Date()
- switch every {
- case "year":
- let newDate = cal.date(byAdding: .year, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "month":
- let newDate = cal.date(byAdding: .month, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "two-weeks":
- let newDate = cal.date(byAdding: .weekOfYear, value: 2 * count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "week":
- let newDate = cal.date(byAdding: .weekOfYear, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "day":
- let newDate = cal.date(byAdding: .day, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "hour":
- let newDate = cal.date(byAdding: .hour, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "minute":
- let newDate = cal.date(byAdding: .minute, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- case "second":
- let newDate = cal.date(byAdding: .second, value: count, to: now)!
- return DateInterval(start: now, end: newDate)
- default:
- return nil
- }
- }
-
- /**
- * Make required UNNotificationCategory entries for action types
- */
- func makeActionTypes(_ actionTypes: [JSObject]) {
- var createdCategories = [UNNotificationCategory]()
-
- let generalCategory = UNNotificationCategory(identifier: "GENERAL",
- actions: [],
- intentIdentifiers: [],
- options: .customDismissAction)
-
- createdCategories.append(generalCategory)
- for type in actionTypes {
- guard let id = type["id"] as? String else {
- CAPLog.print("⚡️ ", self.pluginId, "-", "Action type must have an id field")
- continue
- }
- let hiddenBodyPlaceholder = type["iosHiddenPreviewsBodyPlaceholder"] as? String ?? ""
- let actions = type["actions"] as? [JSObject] ?? []
-
- let newActions = makeActions(actions)
-
- // Create the custom actions for the TIMER_EXPIRED category.
- var newCategory: UNNotificationCategory?
-
- newCategory = UNNotificationCategory(identifier: id,
- actions: newActions,
- intentIdentifiers: [],
- hiddenPreviewsBodyPlaceholder: hiddenBodyPlaceholder,
- options: makeCategoryOptions(type))
-
- createdCategories.append(newCategory!)
- }
-
- let center = UNUserNotificationCenter.current()
- center.setNotificationCategories(Set(createdCategories))
- }
-
- /**
- * Build the required UNNotificationAction objects for each action type registered.
- */
- func makeActions(_ actions: [JSObject]) -> [UNNotificationAction] {
- var createdActions = [UNNotificationAction]()
-
- for action in actions {
- guard let id = action["id"] as? String else {
- CAPLog.print("⚡️ ", self.pluginId, "-", "Action must have an id field")
- continue
- }
- let title = action["title"] as? String ?? ""
- let input = action["input"] as? Bool ?? false
-
- var newAction: UNNotificationAction
- if input {
- let inputButtonTitle = action["inputButtonTitle"] as? String
- let inputPlaceholder = action["inputPlaceholder"] as? String ?? ""
-
- if inputButtonTitle != nil {
- newAction = UNTextInputNotificationAction(identifier: id,
- title: title,
- options: makeActionOptions(action),
- textInputButtonTitle: inputButtonTitle!,
- textInputPlaceholder: inputPlaceholder)
- } else {
- newAction = UNTextInputNotificationAction(identifier: id, title: title, options: makeActionOptions(action))
- }
- } else {
- // Create the custom actions for the TIMER_EXPIRED category.
- newAction = UNNotificationAction(identifier: id,
- title: title,
- options: makeActionOptions(action))
- }
- createdActions.append(newAction)
- }
-
- return createdActions
- }
-
- /**
- * Make options for UNNotificationActions
- */
- func makeActionOptions(_ action: JSObject) -> UNNotificationActionOptions {
- let foreground = action["foreground"] as? Bool ?? false
- let destructive = action["destructive"] as? Bool ?? false
- let requiresAuthentication = action["requiresAuthentication"] as? Bool ?? false
-
- if foreground {
- return .foreground
- }
- if destructive {
- return .destructive
- }
- if requiresAuthentication {
- return .authenticationRequired
- }
- return UNNotificationActionOptions(rawValue: 0)
- }
-
- /**
- * Make options for UNNotificationCategoryActions
- */
- func makeCategoryOptions(_ type: JSObject) -> UNNotificationCategoryOptions {
- let customDismiss = type["iosCustomDismissAction"] as? Bool ?? false
- let carPlay = type["iosAllowInCarPlay"] as? Bool ?? false
- let hiddenPreviewsShowTitle = type["iosHiddenPreviewsShowTitle"] as? Bool ?? false
- let hiddenPreviewsShowSubtitle = type["iosHiddenPreviewsShowSubtitle"] as? Bool ?? false
-
- if customDismiss {
- return .customDismissAction
- }
- if carPlay {
- return .allowInCarPlay
- }
-
- if hiddenPreviewsShowTitle {
- return .hiddenPreviewsShowTitle
- }
- if hiddenPreviewsShowSubtitle {
- return .hiddenPreviewsShowSubtitle
- }
-
- return UNNotificationCategoryOptions(rawValue: 0)
- }
-
- /**
- * Build the UNNotificationAttachment object for each attachment supplied.
- */
- func makeAttachments(_ attachments: [JSObject]) throws -> [UNNotificationAttachment] {
- var createdAttachments = [UNNotificationAttachment]()
-
- for attachment in attachments {
- guard let id = attachment["id"] as? String else {
- throw LocalNotificationError.attachmentNoId
- }
- guard let url = attachment["url"] as? String else {
- throw LocalNotificationError.attachmentNoUrl
- }
- guard let urlObject = makeAttachmentUrl(url) else {
- throw LocalNotificationError.attachmentFileNotFound(path: url)
- }
-
- let options = attachment["options"] as? JSObject ?? [:]
-
- do {
- let newAttachment = try UNNotificationAttachment(identifier: id, url: urlObject, options: makeAttachmentOptions(options))
- createdAttachments.append(newAttachment)
- } catch {
- throw LocalNotificationError.attachmentUnableToCreate(error.localizedDescription)
- }
- }
-
- return createdAttachments
- }
-
- /**
- * Get the internal URL for the attachment URL
- */
- func makeAttachmentUrl(_ path: String) -> URL? {
- guard let webURL = URL(string: path) else {
- return nil
- }
-
- return bridge?.localURL(fromWebURL: webURL)
- }
-
- /**
- * Build the options for the attachment, if any. (For example: the clipping rectangle to use
- * for image attachments)
- */
- func makeAttachmentOptions(_ options: JSObject) -> JSObject {
- var opts: JSObject = [:]
-
- if let iosUNNotificationAttachmentOptionsTypeHintKey = options["iosUNNotificationAttachmentOptionsTypeHintKey"] as? String {
- opts[UNNotificationAttachmentOptionsTypeHintKey] = iosUNNotificationAttachmentOptionsTypeHintKey
- }
- if let iosUNNotificationAttachmentOptionsThumbnailHiddenKey = options["iosUNNotificationAttachmentOptionsThumbnailHiddenKey"] as? String {
- opts[UNNotificationAttachmentOptionsThumbnailHiddenKey] = iosUNNotificationAttachmentOptionsThumbnailHiddenKey
- }
- if let iosUNNotificationAttachmentOptionsThumbnailClippingRectKey = options["iosUNNotificationAttachmentOptionsThumbnailClippingRectKey"] as? String {
- opts[UNNotificationAttachmentOptionsThumbnailClippingRectKey] = iosUNNotificationAttachmentOptionsThumbnailClippingRectKey
- }
- if let iosUNNotificationAttachmentOptionsThumbnailTimeKey = options["iosUNNotificationAttachmentOptionsThumbnailTimeKey"] as? String {
- opts[UNNotificationAttachmentOptionsThumbnailTimeKey] = iosUNNotificationAttachmentOptionsThumbnailTimeKey
- }
- return opts
- }
-
- /**
- * Get notifications in Notification Center
- */
- @objc func getDeliveredNotifications(_ call: CAPPluginCall) {
- UNUserNotificationCenter.current().getDeliveredNotifications(completionHandler: { (notifications) in
- let ret = notifications.map({ (notification) -> [String: Any] in
- return self.notificationDelegationHandler.makeNotificationRequestJSObject(notification.request)
- })
- call.resolve([
- "notifications": ret
- ])
- })
- }
-
- /**
- * Remove specified notifications from Notification Center
- */
- @objc func removeDeliveredNotifications(_ call: CAPPluginCall) {
- guard let notifications = call.getArray("notifications", JSObject.self) else {
- call.reject("Must supply notifications to remove")
- return
- }
-
- let ids = notifications.map { "\($0["id"] ?? "")" }
- UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: ids)
- call.resolve()
- }
-
- /**
- * Remove all notifications from Notification Center
- */
- @objc func removeAllDeliveredNotifications(_ call: CAPPluginCall) {
- UNUserNotificationCenter.current().removeAllDeliveredNotifications()
- DispatchQueue.main.async(execute: {
- UIApplication.shared.applicationIconBadgeNumber = 0
- })
- call.resolve()
- }
-
- @objc func createChannel(_ call: CAPPluginCall) {
- call.unimplemented()
- }
-
- @objc func deleteChannel(_ call: CAPPluginCall) {
- call.unimplemented()
- }
-
- @objc func listChannels(_ call: CAPPluginCall) {
- call.unimplemented()
- }
-}
diff --git a/local-notifications/ios/Tests/LocalNotificationsPluginTests/LocalNotificationsPluginTests.swift b/local-notifications/ios/Tests/LocalNotificationsPluginTests/LocalNotificationsPluginTests.swift
deleted file mode 100644
index 83aea19f3..000000000
--- a/local-notifications/ios/Tests/LocalNotificationsPluginTests/LocalNotificationsPluginTests.swift
+++ /dev/null
@@ -1,12 +0,0 @@
-import XCTest
-@testable import LocalNotificationsPlugin
-
-final class LocalNotificationsPluginTests: XCTestCase {
- func testExample() throws {
- // XCTest Documentation
- // https://developer.apple.com/documentation/xctest
-
- // Defining Test Cases and Test Methods
- // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
- }
-}
diff --git a/local-notifications/package.json b/local-notifications/package.json
deleted file mode 100644
index 07cffbc7d..000000000
--- a/local-notifications/package.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "name": "@capacitor/local-notifications",
- "version": "9.0.0-alpha.2",
- "description": "The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).",
- "main": "dist/plugin.cjs.js",
- "module": "dist/esm/index.js",
- "types": "dist/esm/index.d.ts",
- "unpkg": "dist/plugin.js",
- "files": [
- "android/src/main/",
- "android/build.gradle",
- "dist/",
- "ios/Sources",
- "ios/Tests",
- "Package.swift",
- "CapacitorLocalNotifications.podspec"
- ],
- "author": "Ionic ",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/ionic-team/capacitor-plugins.git"
- },
- "bugs": {
- "url": "https://github.com/ionic-team/capacitor-plugins/issues"
- },
- "keywords": [
- "capacitor",
- "plugin",
- "native"
- ],
- "scripts": {
- "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
- "verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -destination generic/platform=iOS",
- "verify:android": "cd android && ./gradlew clean build test && cd ..",
- "verify:web": "npm run build",
- "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
- "eslint": "eslint . --ext ts",
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
- "swiftlint": "node-swiftlint",
- "docgen": "docgen --api LocalNotificationsPlugin --output-readme README.md --output-json dist/docs.json",
- "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
- "clean": "rimraf ./dist",
- "watch": "tsc --watch",
- "prepublishOnly": "npm run build",
- "publish:cocoapod": "pod trunk push ./CapacitorLocalNotifications.podspec --allow-warnings"
- },
- "devDependencies": {
- "@capacitor/android": "next",
- "@capacitor/cli": "next",
- "@capacitor/core": "next",
- "@capacitor/docgen": "0.3.0",
- "@capacitor/ios": "next",
- "@ionic/eslint-config": "^0.4.0",
- "@ionic/prettier-config": "^4.0.0",
- "@ionic/swiftlint-config": "^2.0.0",
- "eslint": "^8.57.1",
- "prettier": "^3.6.2",
- "prettier-plugin-java": "^2.7.7",
- "rimraf": "^6.1.0",
- "rollup": "^4.53.2",
- "swiftlint": "^2.0.0",
- "typescript": "^5.9.3"
- },
- "peerDependencies": {
- "@capacitor/core": ">=9.0.0-alpha.0"
- },
- "prettier": "@ionic/prettier-config",
- "swiftlint": "@ionic/swiftlint-config",
- "eslintConfig": {
- "extends": "@ionic/eslint-config/recommended"
- },
- "capacitor": {
- "ios": {
- "src": "ios"
- },
- "android": {
- "src": "android"
- }
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/local-notifications/rollup.config.mjs b/local-notifications/rollup.config.mjs
deleted file mode 100644
index 9898ed195..000000000
--- a/local-notifications/rollup.config.mjs
+++ /dev/null
@@ -1,22 +0,0 @@
-export default {
- input: 'dist/esm/index.js',
- output: [
- {
- file: 'dist/plugin.js',
- format: 'iife',
- name: 'capacitorLocalNotifications',
- globals: {
- '@capacitor/core': 'capacitorExports',
- },
- sourcemap: true,
- inlineDynamicImports: true,
- },
- {
- file: 'dist/plugin.cjs.js',
- format: 'cjs',
- sourcemap: true,
- inlineDynamicImports: true,
- },
- ],
- external: ['@capacitor/core'],
-};
diff --git a/local-notifications/src/definitions.ts b/local-notifications/src/definitions.ts
deleted file mode 100644
index 3e8f78728..000000000
--- a/local-notifications/src/definitions.ts
+++ /dev/null
@@ -1,1262 +0,0 @@
-///
-
-import type { PermissionState, PluginListenerHandle } from '@capacitor/core';
-
-export type LocalNotificationPresentationOption = 'badge' | 'sound' | 'banner' | 'list';
-
-declare module '@capacitor/cli' {
- export interface PluginsConfig {
- /**
- * The Local Notifications can be configured with the following options:
- */
- LocalNotifications?: {
- /**
- * 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.
- *
- * @since 1.0.0
- * @example "ic_stat_icon_config_sample"
- */
- smallIcon?: string;
-
- /**
- * Set the default color of status bar icons for notifications.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- * @example "#488AFF"
- */
- iconColor?: string;
-
- /**
- * Set the default notification sound for notifications.
- *
- * It sets the default channel sound and can't be
- * changed unless the app is uninstalled.
- *
- * If the audio file is not found, it will result in no sound.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- * @example "beep.wav"
- */
- sound?: string;
-
- /**
- * This is an array of strings you can combine. Possible values in the array are:
- * - `badge`: badge count on the app icon is updated (default value)
- * - `sound`: the device will ring/vibrate when the notification is received
- * - `banner`: the notification is displayed as a banner
- * - `list`: the notification is displayed in the notification center
- *
- * An empty array can be provided if none of the options are desired.
- *
- * Only available for iOS.
- *
- * @since 8.2.0
- * @example ["badge", "sound", "banner", "list"]
- */
- presentationOptions?: LocalNotificationPresentationOption[];
- };
- }
-}
-
-export interface LocalNotificationsPlugin {
- /**
- * Schedule one or more local notifications.
- *
- * @since 1.0.0
- */
- schedule(options: ScheduleOptions): Promise;
-
- /**
- * Get a list of pending notifications.
- *
- * @since 1.0.0
- */
- getPending(): Promise;
-
- /**
- * Register actions to take when notifications are displayed.
- *
- * Only available for iOS and Android.
- *
- * @since 1.0.0
- */
- registerActionTypes(options: RegisterActionTypesOptions): Promise;
-
- /**
- * Cancel pending notifications.
- *
- * @since 1.0.0
- */
- cancel(options: CancelOptions): Promise;
-
- /**
- * Check if notifications are enabled or not.
- *
- * @deprecated Use `checkPermissions()` to check if the user has allowed
- * notifications to be displayed.
- * @since 1.0.0
- */
- areEnabled(): Promise;
-
- /**
- * Get a list of notifications that are visible on the notifications screen.
- *
- * @since 4.0.0
- */
- getDeliveredNotifications(): Promise;
-
- /**
- * Remove the specified notifications from the notifications screen.
- *
- * @since 4.0.0
- */
- removeDeliveredNotifications(delivered: DeliveredNotifications): Promise;
-
- /**
- * Remove all the notifications from the notifications screen.
- *
- * @since 4.0.0
- */
- removeAllDeliveredNotifications(): Promise;
-
- /**
- * Create a notification channel.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- createChannel(channel: Channel): Promise;
-
- /**
- * Delete a notification channel.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- deleteChannel(args: { id: string }): Promise;
-
- /**
- * Get a list of notification channels.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- listChannels(): Promise;
-
- /**
- * Check permission to display local notifications.
- *
- * @since 1.0.0
- */
- checkPermissions(): Promise;
-
- /**
- * Request permission to display local notifications.
- *
- * @since 1.0.0
- */
- requestPermissions(): Promise;
-
- /**
- * Direct user to the application settings screen to configure exact alarms.
- *
- * In the event that a user changes the settings from granted to denied, the application
- * will restart and any notification scheduled with an exact alarm will be deleted.
- *
- * On Android < 12, the user will NOT be directed to the application settings screen, instead this function will
- * return `granted`.
- *
- * Only available on Android.
- *
- * @since 6.0.0
- */
- changeExactNotificationSetting(): Promise;
-
- /**
- * Check application setting for using exact alarms.
- *
- * Only available on Android.
- *
- * @since 6.0.0
- */
- checkExactNotificationSetting(): Promise;
-
- /**
- * Listen for when notifications are displayed.
- *
- * @since 1.0.0
- */
- addListener(
- eventName: 'localNotificationReceived',
- listenerFunc: (notification: LocalNotificationSchema) => void,
- ): Promise;
-
- /**
- * Listen for when an action is performed on a notification.
- *
- * @since 1.0.0
- */
- addListener(
- eventName: 'localNotificationActionPerformed',
- listenerFunc: (notificationAction: ActionPerformed) => void,
- ): Promise;
-
- /**
- * Remove all listeners for this plugin.
- *
- * @since 1.0.0
- */
- removeAllListeners(): Promise;
-}
-
-/**
- * The object that describes a local notification.
- *
- * @since 1.0.0
- */
-export interface LocalNotificationDescriptor {
- /**
- * The notification identifier.
- *
- * @since 1.0.0
- */
- id: number;
-}
-
-export interface ScheduleOptions {
- /**
- * The list of notifications to schedule.
- *
- * @since 1.0.0
- */
- notifications: LocalNotificationSchema[];
-}
-
-export interface ScheduleResult {
- /**
- * The list of scheduled notifications.
- *
- * @since 1.0.0
- */
- notifications: LocalNotificationDescriptor[];
-}
-
-export interface PendingResult {
- /**
- * The list of pending notifications.
- *
- * @since 1.0.0
- */
- notifications: PendingLocalNotificationSchema[];
-}
-
-export interface RegisterActionTypesOptions {
- /**
- * The list of action types to register.
- *
- * @since 1.0.0
- */
- types: ActionType[];
-}
-
-export interface CancelOptions {
- /**
- * The list of notifications to cancel.
- *
- * @since 1.0.0
- */
- notifications: LocalNotificationDescriptor[];
-}
-
-/**
- * A collection of actions.
- *
- * @since 1.0.0
- */
-export interface ActionType {
- /**
- * The ID of the action type.
- *
- * Referenced in notifications by the `actionTypeId` key.
- *
- * @since 1.0.0
- */
- id: string;
-
- /**
- * The list of actions associated with this action type.
- *
- * @since 1.0.0
- */
- actions?: Action[];
-
- /**
- * Sets `hiddenPreviewsBodyPlaceholder` of the
- * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosHiddenPreviewsBodyPlaceholder?: string;
-
- /**
- * Sets `customDismissAction` in the options of the
- * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosCustomDismissAction?: boolean;
-
- /**
- * Sets `allowInCarPlay` in the options of the
- * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosAllowInCarPlay?: boolean;
-
- /**
- * Sets `hiddenPreviewsShowTitle` in the options of the
- * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosHiddenPreviewsShowTitle?: boolean;
-
- /**
- * Sets `hiddenPreviewsShowSubtitle` in the options of the
- * [`UNNotificationCategory`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosHiddenPreviewsShowSubtitle?: boolean;
-}
-
-/**
- * An action that can be taken when a notification is displayed.
- *
- * @since 1.0.0
- */
-export interface Action {
- /**
- * The action identifier.
- *
- * Referenced in the `'actionPerformed'` event as `actionId`.
- *
- * @since 1.0.0
- */
- id: string;
-
- /**
- * The title text to display for this action.
- *
- * @since 1.0.0
- */
- title: string;
-
- /**
- * Sets `authenticationRequired` in the options of the
- * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- requiresAuthentication?: boolean;
-
- /**
- * Sets `foreground` in the options of the
- * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- foreground?: boolean;
-
- /**
- * Sets `destructive` in the options of the
- * [`UNNotificationAction`](https://developer.apple.com/documentation/usernotifications/unnotificationaction).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- destructive?: boolean;
-
- /**
- * Use a `UNTextInputNotificationAction` instead of a `UNNotificationAction`.
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- input?: boolean;
-
- /**
- * Sets `textInputButtonTitle` on the
- * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).
- *
- * Only available for iOS when `input` is `true`.
- *
- * @since 1.0.0
- */
- inputButtonTitle?: string;
-
- /**
- * Sets `textInputPlaceholder` on the
- * [`UNTextInputNotificationAction`](https://developer.apple.com/documentation/usernotifications/untextinputnotificationaction).
- *
- * Only available for iOS when `input` is `true`.
- *
- * @since 1.0.0
- */
- inputPlaceholder?: string;
-}
-
-/**
- * Represents a notification attachment.
- *
- * @since 1.0.0
- */
-export interface Attachment {
- /**
- * The attachment identifier.
- *
- * @since 1.0.0
- */
- id: string;
-
- /**
- * The URL to the attachment.
- *
- * Use the `res` scheme to reference web assets, e.g.
- * `res:///assets/img/icon.png`. Also accepts `file` URLs.
- *
- * @since 1.0.0
- */
- url: string;
-
- /**
- * Attachment options.
- *
- * @since 1.0.0
- */
- options?: AttachmentOptions;
-}
-
-export interface AttachmentOptions {
- /**
- * Sets the `UNNotificationAttachmentOptionsTypeHintKey` key in the hashable
- * options of
- * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosUNNotificationAttachmentOptionsTypeHintKey?: string;
-
- /**
- * Sets the `UNNotificationAttachmentOptionsThumbnailHiddenKey` key in the
- * hashable options of
- * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosUNNotificationAttachmentOptionsThumbnailHiddenKey?: string;
-
- /**
- * Sets the `UNNotificationAttachmentOptionsThumbnailClippingRectKey` key in
- * the hashable options of
- * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosUNNotificationAttachmentOptionsThumbnailClippingRectKey?: string;
-
- /**
- * Sets the `UNNotificationAttachmentOptionsThumbnailTimeKey` key in the
- * hashable options of
- * [`UNNotificationAttachment`](https://developer.apple.com/documentation/usernotifications/unnotificationattachment).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- iosUNNotificationAttachmentOptionsThumbnailTimeKey?: string;
-}
-
-export interface PendingLocalNotificationSchema {
- /**
- * The title of the notification.
- *
- * @since 1.0.0
- */
- title: string;
-
- /**
- * The body of the notification, shown below the title.
- *
- * @since 1.0.0
- */
- body: string;
-
- /**
- * The notification identifier.
- *
- * @since 1.0.0
- */
- id: number;
-
- /**
- * Schedule this notification for a later time.
- *
- * @since 1.0.0
- */
- schedule?: Schedule;
-
- /**
- * Set extra data to store within this notification.
- *
- * @since 1.0.0
- */
- extra?: any;
-}
-
-export interface LocalNotificationSchema {
- /**
- * The title of the notification.
- *
- * @since 1.0.0
- */
- title: string;
-
- /**
- * The body of the notification, shown below the title.
- *
- * @since 1.0.0
- */
- body: string;
-
- /**
- * Sets a multiline text block for display in a big text notification style.
- *
- * @since 1.0.0
- */
- largeBody?: string;
-
- /**
- * Used to set the summary text detail in inbox and big text notification styles.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- summaryText?: string;
- /**
- * The notification identifier.
- * On Android it's a 32-bit int.
- * So the value should be between -2147483648 and 2147483647 inclusive.
- *
- * @since 1.0.0
- */
- id: number;
-
- /**
- * Schedule this notification for a later time.
- *
- * @since 1.0.0
- */
- schedule?: Schedule;
-
- /**
- * Name of the audio file to play when this notification is displayed.
- *
- * Include the file extension with the filename.
- *
- * The file should be in the app bundle.
- *
- * Recommended format is `.wav`.
- *
- * Only available for iOS.
- * For Android, use channelId of a channel configured with the desired sound.
- *
- * If the sound file is not found, (i.e. empty string or wrong name)
- * the default system notification sound will be used.
- * If not provided, it will produce no sound.
- *
- * @since 1.0.0
- */
- sound?: string;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- smallIcon?: string;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- largeIcon?: string;
-
- /**
- * Set the color of the notification icon.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- iconColor?: string;
-
- /**
- * Set attachments for this notification.
- *
- * @since 1.0.0
- */
- attachments?: Attachment[];
-
- /**
- * Associate an action type with this notification.
- *
- * @since 1.0.0
- */
- actionTypeId?: string;
-
- /**
- * Set extra data to store within this notification.
- *
- * @since 1.0.0
- */
- extra?: any;
-
- /**
- * Used to group multiple notifications.
- *
- * Sets `threadIdentifier` on the
- * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- threadIdentifier?: string;
-
- /**
- * The score the system uses to determine if the notification is the
- * featured notification when the system groups the app's notifications.
- *
- * The value must be between 0 and 1, where 0 is the least relevant and
- * 1 is the most relevant. The default value is 0.
- *
- * Sets `relevanceScore` on the
- * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
- *
- * Only available for iOS.
- *
- * @since 8.1.0
- */
- relevanceScore?: number;
-
- /**
- * The interruption level that indicates the priority and delivery timing of a notification.
- *
- * Sets `interruptionLevel` on the
- * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
- *
- * Only available for iOS.
- *
- * @since 8.1.0
- */
- interruptionLevel?: InterruptionLevel;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- group?: string;
-
- /**
- * 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`.
- *
- * @since 1.0.0
- */
- groupSummary?: boolean;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- channelId?: string;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- ongoing?: boolean;
-
- /**
- * 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.
- *
- * @since 1.0.0
- */
- autoCancel?: boolean;
-
- /**
- * Sets a list of strings for display in an inbox style notification.
- *
- * Up to 5 strings are allowed.
- *
- * Only available for Android.
- *
- * @since 1.0.0
- */
- inboxList?: string[];
-
- /**
- * If true, notification will not appear while app is in the foreground.
- *
- * Only available for iOS.
- *
- * @since 5.0.0
- */
- silent?: boolean;
-}
-
-/**
- * Represents a schedule for a notification.
- *
- * Use either `at`, `on`, or `every` to schedule notifications.
- *
- * @since 1.0.0
- */
-export interface Schedule {
- /**
- * Schedule a notification at a specific date and time.
- *
- * @since 1.0.0
- */
- at?: Date;
-
- /**
- * Repeat delivery of this notification at the date and time specified by
- * `at`.
- *
- * Only available for iOS and Android.
- *
- * @since 1.0.0
- */
- repeats?: boolean;
-
- /**
- * 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).
- *
- * @since 1.0.0
- */
- allowWhileIdle?: boolean;
-
- /**
- * Schedule 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.
- *
- * @since 1.0.0
- */
- on?: ScheduleOn;
-
- /**
- * Schedule a notification on a particular interval.
- *
- * @since 1.0.0
- */
- every?: ScheduleEvery;
-
- /**
- * Limit the number times a notification is delivered by the interval
- * specified by `every`.
- *
- * @since 1.0.0
- */
- count?: number;
-}
-
-export interface ScheduleOn {
- year?: number;
- month?: number;
- day?: number;
- weekday?: Weekday;
- hour?: number;
- minute?: number;
- second?: number;
-}
-
-export type ScheduleEvery = 'year' | 'month' | 'two-weeks' | 'week' | 'day' | 'hour' | 'minute' | 'second';
-
-/**
- * The interruption level that indicates the priority and delivery timing of a notification.
- *
- * - `active`: The system presents the notification immediately, lights up the screen, and can play a sound.
- * - `critical`: The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.
- * Requires the [Critical Alerts entitlement](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.usernotifications.critical-alerts).
- * - `passive`: The system adds the notification to the notification list without lighting up the screen or playing a sound.
- * - `timeSensitive`: The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls.
- * Requires the Time Sensitive Notifications capability. Without it, the notification may not break through stricter Focus modes such as Do Not Disturb.
- * Even with the capability, the user can disable Time Sensitive notifications per Focus mode in Settings.
- * See [Time Sensitive notifications](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive) for more details.
- *
- * @since 8.1.0
- */
-export type InterruptionLevel = 'active' | 'critical' | 'passive' | 'timeSensitive';
-
-export interface ListChannelsResult {
- /**
- * The list of notification channels.
- *
- * @since 1.0.0
- */
- channels: Channel[];
-}
-
-export interface PermissionStatus {
- /**
- * Permission state of displaying notifications.
- *
- * @since 1.0.0
- */
- display: PermissionState;
-}
-
-export interface SettingsPermissionStatus {
- /**
- * Permission state of using exact alarms.
- *
- * @since 6.0.0
- */
- exact_alarm: PermissionState;
-}
-
-export interface ActionPerformed {
- /**
- * The identifier of the performed action.
- *
- * @since 1.0.0
- */
- actionId: string;
-
- /**
- * The value entered by the user on the notification.
- *
- * Only available on iOS for notifications with `input` set to `true`.
- *
- * @since 1.0.0
- */
- inputValue?: string;
-
- /**
- * The original notification schema.
- *
- * @since 1.0.0
- */
- notification: LocalNotificationSchema;
-}
-
-/**
- * @deprecated
- */
-export interface EnabledResult {
- /**
- * Whether or not the device has local notifications enabled.
- *
- * @since 1.0.0
- */
- value: boolean;
-}
-
-export interface DeliveredNotificationSchema {
- /**
- * The notification identifier.
- *
- * @since 4.0.0
- */
- id: number;
-
- /**
- * The notification tag.
- *
- * Only available on Android.
- *
- * @since 4.0.0
- */
- tag?: string;
- /**
- * The title of the notification.
- *
- * @since 4.0.0
- */
- title: string;
-
- /**
- * The body of the notification, shown below the title.
- *
- * @since 4.0.0
- */
- body: string;
-
- /**
- * The configured group of the notification.
- *
- *
- * Only available for Android.
- *
- * @since 4.0.0
- */
- group?: string;
-
- /**
- * If this notification is the summary for a group of notifications.
- *
- * Only available for Android.
- *
- * @since 4.0.0
- */
- groupSummary?: boolean;
-
- /**
- * Any additional data that was included in the
- * notification payload.
- *
- * Only available for Android.
- *
- * @since 4.0.0
- */
- data?: any;
-
- /**
- * Extra data to store within this notification.
- *
- * Only available for iOS.
- *
- * @since 4.0.0
- */
- extra?: any;
-
- /**
- * The attachments for this notification.
- *
- * Only available for iOS.
- *
- * @since 1.0.0
- */
- attachments?: Attachment[];
-
- /**
- * Action type ssociated with this notification.
- *
- * Only available for iOS.
- *
- * @since 4.0.0
- */
- actionTypeId?: string;
-
- /**
- * Schedule used to fire this notification.
- *
- * Only available for iOS.
- *
- * @since 4.0.0
- */
- schedule?: Schedule;
-
- /**
- * Sound that was used when the notification was displayed.
- *
- * Only available for iOS.
- *
- * @since 4.0.0
- */
- sound?: string;
-}
-
-export interface DeliveredNotifications {
- /**
- * List of notifications that are visible on the
- * notifications screen.
- *
- * @since 1.0.0
- */
- notifications: DeliveredNotificationSchema[];
-}
-
-export interface Channel {
- /**
- * The channel identifier.
- *
- * @since 1.0.0
- */
- id: string;
-
- /**
- * The human-friendly name of this channel (presented to the user).
- *
- * @since 1.0.0
- */
- name: string;
-
- /**
- * The description of this channel (presented to the user).
- *
- * @since 1.0.0
- */
- description?: string;
-
- /**
- * The sound that should be played for notifications posted to this channel.
- *
- * Notification channels with an importance of at least `3` should have a
- * sound.
- *
- * The file name of a sound file should be specified relative to the android
- * app `res/raw` directory.
- *
- * If the sound is not provided, or the sound file is not found no sound will be used.
- *
- * @since 1.0.0
- * @example "jingle.wav"
- */
- sound?: string;
-
- /**
- * The level of interruption for notifications posted to this channel.
- *
- * @default `3`
- * @since 1.0.0
- */
- importance?: Importance;
-
- /**
- * The visibility of notifications posted to this channel.
- *
- * This setting is for whether notifications posted to this channel appear on
- * the lockscreen or not, and if so, whether they appear in a redacted form.
- *
- * @since 1.0.0
- */
- visibility?: Visibility;
-
- /**
- * Whether notifications posted to this channel should display notification
- * lights, on devices that support it.
- *
- * @since 1.0.0
- */
- lights?: boolean;
-
- /**
- * The light color for notifications posted to this channel.
- *
- * Only supported if lights are enabled on this channel and the device
- * supports it.
- *
- * Supported color formats are `#RRGGBB` and `#RRGGBBAA`.
- *
- * @since 1.0.0
- */
- lightColor?: string;
-
- /**
- * Whether notifications posted to this channel should vibrate.
- *
- * @since 1.0.0
- */
- vibration?: boolean;
-}
-
-/**
- * Day of the week. Used for scheduling notifications on a particular weekday.
- */
-export enum Weekday {
- Sunday = 1,
- Monday = 2,
- Tuesday = 3,
- Wednesday = 4,
- Thursday = 5,
- Friday = 6,
- Saturday = 7,
-}
-
-/**
- * The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)
- * @since 1.0.0
- */
-export type Importance = 0 | 1 | 2 | 3 | 4 | 5;
-
-/**
- * The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)
- * @since 1.0.0
- */
-export type Visibility = -1 | 0 | 1;
-
-/**
- * @deprecated Use 'Channel`.
- * @since 1.0.0
- */
-export type NotificationChannel = Channel;
-
-/**
- * @deprecated Use `LocalNotificationDescriptor`.
- * @since 1.0.0
- */
-export type LocalNotificationRequest = LocalNotificationDescriptor;
-
-/**
- * @deprecated Use `ScheduleResult`.
- * @since 1.0.0
- */
-export type LocalNotificationScheduleResult = ScheduleResult;
-
-/**
- * @deprecated Use `PendingResult`.
- * @since 1.0.0
- */
-export type LocalNotificationPendingList = PendingResult;
-
-/**
- * @deprecated Use `ActionType`.
- * @since 1.0.0
- */
-export type LocalNotificationActionType = ActionType;
-
-/**
- * @deprecated Use `Action`.
- * @since 1.0.0
- */
-export type LocalNotificationAction = Action;
-
-/**
- * @deprecated Use `EnabledResult`.
- * @since 1.0.0
- */
-export type LocalNotificationEnabledResult = EnabledResult;
-
-/**
- * @deprecated Use `ListChannelsResult`.
- * @since 1.0.0
- */
-export type NotificationChannelList = ListChannelsResult;
-
-/**
- * @deprecated Use `Attachment`.
- * @since 1.0.0
- */
-export type LocalNotificationAttachment = Attachment;
-
-/**
- * @deprecated Use `AttachmentOptions`.
- * @since 1.0.0
- */
-export type LocalNotificationAttachmentOptions = AttachmentOptions;
-
-/**
- * @deprecated Use `LocalNotificationSchema`.
- * @since 1.0.0
- */
-export type LocalNotification = LocalNotificationSchema;
-
-/**
- * @deprecated Use `Schedule`.
- * @since 1.0.0
- */
-export type LocalNotificationSchedule = Schedule;
-
-/**
- * @deprecated Use `ActionPerformed`.
- * @since 1.0.0
- */
-export type LocalNotificationActionPerformed = ActionPerformed;
diff --git a/local-notifications/src/index.ts b/local-notifications/src/index.ts
deleted file mode 100644
index 65f3ffa76..000000000
--- a/local-notifications/src/index.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { registerPlugin } from '@capacitor/core';
-
-import type { LocalNotificationsPlugin } from './definitions';
-
-const LocalNotifications = registerPlugin('LocalNotifications', {
- web: () => import('./web').then((m) => new m.LocalNotificationsWeb()),
-});
-
-export * from './definitions';
-export { LocalNotifications };
diff --git a/local-notifications/src/web.ts b/local-notifications/src/web.ts
deleted file mode 100644
index 79449c435..000000000
--- a/local-notifications/src/web.ts
+++ /dev/null
@@ -1,213 +0,0 @@
-import { WebPlugin } from '@capacitor/core';
-import type { PermissionState } from '@capacitor/core';
-
-import type {
- DeliveredNotifications,
- EnabledResult,
- ListChannelsResult,
- LocalNotificationSchema,
- LocalNotificationsPlugin,
- PendingResult,
- PermissionStatus,
- ScheduleOptions,
- ScheduleResult,
- SettingsPermissionStatus,
-} from './definitions';
-
-export class LocalNotificationsWeb extends WebPlugin implements LocalNotificationsPlugin {
- protected pending: LocalNotificationSchema[] = [];
- protected deliveredNotifications: Notification[] = [];
-
- async getDeliveredNotifications(): Promise {
- const deliveredSchemas = [];
- for (const notification of this.deliveredNotifications) {
- const deliveredSchema: LocalNotificationSchema = {
- title: notification.title,
- id: parseInt(notification.tag),
- body: notification.body,
- };
- deliveredSchemas.push(deliveredSchema);
- }
- return {
- notifications: deliveredSchemas,
- };
- }
- async removeDeliveredNotifications(delivered: DeliveredNotifications): Promise {
- for (const toRemove of delivered.notifications) {
- const found = this.deliveredNotifications.find((n) => n.tag === String(toRemove.id));
- found?.close();
- this.deliveredNotifications = this.deliveredNotifications.filter(() => !found);
- }
- }
- async removeAllDeliveredNotifications(): Promise {
- for (const notification of this.deliveredNotifications) {
- notification.close();
- }
- this.deliveredNotifications = [];
- }
- async createChannel(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async deleteChannel(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async listChannels(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async schedule(options: ScheduleOptions): Promise {
- if (!this.hasNotificationSupport()) {
- throw this.unavailable('Notifications not supported in this browser.');
- }
-
- for (const notification of options.notifications) {
- this.sendNotification(notification);
- }
-
- return {
- notifications: options.notifications.map((notification) => ({
- id: notification.id,
- })),
- };
- }
-
- async getPending(): Promise {
- return {
- notifications: this.pending,
- };
- }
-
- async registerActionTypes(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async cancel(pending: ScheduleResult): Promise {
- this.pending = this.pending.filter((notification) => !pending.notifications.find((n) => n.id === notification.id));
- }
-
- async areEnabled(): Promise {
- const { display } = await this.checkPermissions();
-
- return {
- value: display === 'granted',
- };
- }
-
- async changeExactNotificationSetting(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async checkExactNotificationSetting(): Promise {
- throw this.unimplemented('Not implemented on web.');
- }
-
- async requestPermissions(): Promise {
- if (!this.hasNotificationSupport()) {
- throw this.unavailable('Notifications not supported in this browser.');
- }
-
- const display = this.transformNotificationPermission(await Notification.requestPermission());
-
- return { display };
- }
-
- async checkPermissions(): Promise {
- if (!this.hasNotificationSupport()) {
- throw this.unavailable('Notifications not supported in this browser.');
- }
-
- const display = this.transformNotificationPermission(Notification.permission);
-
- return { display };
- }
-
- protected hasNotificationSupport = (): boolean => {
- if (!('Notification' in window) || !Notification.requestPermission) {
- return false;
- }
-
- if (Notification.permission !== 'granted') {
- // don't test for `new Notification` if permission has already been granted
- // otherwise this sends a real notification on supported browsers
- try {
- new Notification('');
- } catch (e) {
- if (e instanceof Error && e.name === 'TypeError') {
- return false;
- }
- }
- }
-
- return true;
- };
-
- protected transformNotificationPermission(permission: NotificationPermission): PermissionState {
- switch (permission) {
- case 'granted':
- return 'granted';
- case 'denied':
- return 'denied';
- default:
- return 'prompt';
- }
- }
-
- protected sendPending(): void {
- const toRemove: LocalNotificationSchema[] = [];
- const now = new Date().getTime();
-
- for (const notification of this.pending) {
- if (notification.schedule?.at && notification.schedule.at.getTime() <= now) {
- this.buildNotification(notification);
- toRemove.push(notification);
- }
- }
-
- this.pending = this.pending.filter((notification) => !toRemove.find((n) => n === notification));
- }
-
- protected sendNotification(notification: LocalNotificationSchema): void {
- if (notification.schedule?.at) {
- const diff = notification.schedule.at.getTime() - new Date().getTime();
-
- this.pending.push(notification);
- setTimeout(() => {
- this.sendPending();
- }, diff);
- return;
- }
- this.buildNotification(notification);
- }
-
- protected buildNotification(notification: LocalNotificationSchema): Notification {
- const localNotification = new Notification(notification.title, {
- body: notification.body,
- tag: String(notification.id),
- });
- localNotification.addEventListener('click', this.onClick.bind(this, notification), false);
- localNotification.addEventListener('show', this.onShow.bind(this, notification), false);
- localNotification.addEventListener(
- 'close',
- () => {
- this.deliveredNotifications = this.deliveredNotifications.filter(() => !this);
- },
- false,
- );
- this.deliveredNotifications.push(localNotification);
- return localNotification;
- }
-
- protected onClick(notification: LocalNotificationSchema): void {
- const data = {
- actionId: 'tap',
- notification,
- };
- this.notifyListeners('localNotificationActionPerformed', data);
- }
-
- protected onShow(notification: LocalNotificationSchema): void {
- this.notifyListeners('localNotificationReceived', notification);
- }
-}
diff --git a/local-notifications/tsconfig.json b/local-notifications/tsconfig.json
deleted file mode 100644
index f2e88e6a0..000000000
--- a/local-notifications/tsconfig.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "compilerOptions": {
- "allowUnreachableCode": false,
- "declaration": true,
- "esModuleInterop": true,
- "inlineSources": true,
- "lib": ["dom", "es2017"],
- "module": "esnext",
- "moduleResolution": "node",
- "noFallthroughCasesInSwitch": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "outDir": "dist/esm",
- "pretty": true,
- "sourceMap": true,
- "strict": true,
- "target": "es2017"
- },
- "files": ["src/index.ts"]
-}
diff --git a/nx.json b/nx.json
index 7e51533bf..cb877a20f 100644
--- a/nx.json
+++ b/nx.json
@@ -19,7 +19,6 @@
"{projectRoot}/clipboard/dist",
"{projectRoot}/device/dist",
"{projectRoot}/dialog/dist",
- "{projectRoot}/local-notifications/dist",
"{projectRoot}/motion/dist",
"{projectRoot}/network/dist",
"{projectRoot}/preferences/dist",
diff --git a/package.json b/package.json
index 4cf06e152..c26059843 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,6 @@
"clipboard",
"device",
"dialog",
- "local-notifications",
"motion",
"network",
"preferences",