HaylLtd / cordova-background-geolocation-plugin

Background and foreground geolocation plugin for Cordova.
Apache License 2.0
56 stars 64 forks source link

How to check if notifications permission was granted? #193

Open AbdullahSohail-SE opened 3 months ago

AbdullahSohail-SE commented 3 months ago

Is your feature request related to a problem? Please describe. Currently there isn't any flag or method to check if notification permission was granted or not, this makes it tricky to implement some sort of UI flow where user will be asked to grant notification permission if not provided consider the example provided in https://developer.android.com/develop/ui/views/notifications/notification-permission#wait-to-show-prompt

Describe the solution you'd like Perhaps an additional flag in checkStatus() (https://developer.android.com/develop/ui/views/notifications/notification-permission#wait-to-show-prompt) method would be a great help such as hasNotificationsEnabled etc.

Describe alternatives you've considered Havent considered any alternatives yet but i guess i would have to use some external package specifically to check if POST_NOTIFICATIONS permission was granted or not.

Additional context None

HarelM commented 3 months ago

I see your point. Check status makes sense. Feel free to open a PR to implement this.