From 7f3d541cb7826fbff5edb2b6858307e5bc02e62e Mon Sep 17 00:00:00 2001 From: censujiang Date: Mon, 4 Aug 2025 17:05:39 +0800 Subject: [PATCH 1/2] fix: update permission dependency version to ^3.0.4 and simplify authorization check --- packages/local-notifications/index.android.ts | 3 +-- packages/local-notifications/package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/local-notifications/index.android.ts b/packages/local-notifications/index.android.ts index cc99c905..8e89d4f1 100755 --- a/packages/local-notifications/index.android.ts +++ b/packages/local-notifications/index.android.ts @@ -296,8 +296,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements } private static isAuthorized(result: Result): boolean { - const [status, _] = result; - return status === 'authorized'; + return result === 'authorized'; } } diff --git a/packages/local-notifications/package.json b/packages/local-notifications/package.json index 03e04619..e24e61ff 100644 --- a/packages/local-notifications/package.json +++ b/packages/local-notifications/package.json @@ -46,6 +46,6 @@ "homepage": "https://github.com/nativescript/plugins", "dependencies": { "@nativescript/shared-notification-delegate": "~1.0.0", - "@nativescript-community/perms": "^2.3.0" + "@nativescript-community/perms": "^3.0.4" } } From 77242109a72c5d8a81540e6fb3222548a3e297a5 Mon Sep 17 00:00:00 2001 From: censujiang Date: Mon, 4 Aug 2025 17:21:35 +0800 Subject: [PATCH 2/2] fix: specify result type in isAuthorized method for better type safety --- packages/local-notifications/index.android.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/local-notifications/index.android.ts b/packages/local-notifications/index.android.ts index 8e89d4f1..b7f927e3 100755 --- a/packages/local-notifications/index.android.ts +++ b/packages/local-notifications/index.android.ts @@ -121,7 +121,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements success: (notification) => { onReceived(JSON.parse(notification)); }, - }) + }), ); resolve(); } catch (ex) { @@ -140,7 +140,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements success: (notification) => { onReceived(JSON.parse(notification)); }, - }) + }), ); resolve(); } catch (ex) { @@ -295,7 +295,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements } } - private static isAuthorized(result: Result): boolean { + private static isAuthorized(result: Result<'notification'>): boolean { return result === 'authorized'; } }