OneSignal / OneSignal-Website-SDK

OneSignal is a push notification service for web and mobile apps. This SDK makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Other
389 stars 115 forks source link

[Question]: how to tell when Onesignal.Notifications.requestPermission() fails? #1198

Open ggrochow-dh opened 1 month ago

ggrochow-dh commented 1 month ago

How can we help?

Assuming I have blocked browser notification permission for the site I am doing this on.

when calling Onesignal.Notifications.requestPermission() I see an error output in the console, but get 0 feedback from the function call, and im unable to catch the error.

How can I tell when this has failed? I want to be able to instruct the user they have to manually change their browser settings, but it seems like there is no way to get any feedback around this very critical part of this whole process not working.