Skip to content

[@nativescript/local-notifications] [Android] Requires runtime permission dialog to allow notifications. #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
7ammer opened this issue Sep 20, 2022 · 3 comments · Fixed by #472

Comments

@7ammer
Copy link

7ammer commented Sep 20, 2022

It appears that android13 (SDK33) now requires a runtime permission for setting local notifications:
https://developer.android.com/develop/ui/views/notifications/notification-permission#user-choice

I get this error when running the LocalNotifications.schedule method: Permission not granted..

I've tried just adding this permission: <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> but nothing changes.

If I grant notification permissions to the app via App info > Permissions then everything works fine again.

@robertosw
Copy link

Got the same problem, it does not matter at all where in the code you try .requestPermission, it will always return false because there will be no Popup triggered in Android.
As soon as you manually allow Notifications in the App Settings in Android, .requestPermission will always return true

@tobiAdBr
Copy link

Got the same problem. Looks like the permissions dialog has to be implemented manually

@XR-115
Copy link

XR-115 commented Nov 28, 2024

Hello! I would just like to comment that if you have problems with these permissions that have not been granted, you could check the android version of your project "@nativescript/android" to see if it is compatible, you can run ns info and validate the updated version of your android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants