Open 7ammer opened 2 years ago
@7ammer It is now added in latest version ('notification'). Also know that as of now you can also pass native android permissions directly to check
and request
like "android.permission.POST_NOTIFICATIONS"
. That way you dont need to wait for me implement it anymore ;)
Hi @farfromrefug, thanks for implementing this and for the tip!
I seem to be running into an issue where the response from request
is always [ 'never_ask_again', true ]
. I've tried uninstalling the app to reset any user set permissions but nothing changes. I am using an emulator running sdk33.
@7ammer i had the same issue. You need to ensure your targetSdkVersion is 33. I think same for compileSdkVersion
@farfromrefug Yes, after using targetSdkVersion 33 it is working as expected. How do we show the permission request reason? I tried passing the message as a string to the requestOptions param like so,
nscRequestPermission(
'notification',
'<reason_text_here>'
)
am I missing something?
@shiv19 i dont see the native api to do so. Can you share a link?
Ah yes you're right. There is no api support for it. They recommend using a separate screen for it. Thanks! https://developer.android.com/develop/ui/views/notifications/notification-permission#request-in-context
It seems like android 13 / SDK33 now requires permissions for notifications called
POST_NOTIFICATIONS
.From reading the below link it looks like you need to declare the permission in the app's manifest file AND request permission at runtime: https://developer.android.com/develop/ui/views/notifications/notification-permission
Is it possible to add this permission to this package?