plugins icon indicating copy to clipboard operation
plugins copied to clipboard

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

Open 7ammer opened this issue 3 years ago • 1 comments

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.

7ammer avatar Sep 20 '22 11:09 7ammer

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

robertosw avatar Sep 29 '22 08:09 robertosw

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

tobiAdBr avatar Feb 16 '23 15:02 tobiAdBr