What could be the cause of this error
messaging/permission-blocked
in firebase messaging. Im getting this error when I try to ask for permission to receive notifications on the web
What could be the cause of this error
messaging/permission-blocked
in firebase messaging. Im getting this error when I try to ask for permission to receive notifications on the web
1 Answer
Reset to default 2The error indicates that the user has blocked your site from receiving push notifications on a browser level.
If this occurs for...
- You, you'll have to check your browser settings and unblock the site.
- A user then you are out of luck, your site is blocked indefinitely.
Do not be annoying about asking for permission. Blocking your site (indefinitely) is a very easy step for a user to take. Once they click it, your done. The likelihood of you getting them to unblock your site is next to nothing.
The UX around asking for permission should look something like this:
Ask for permission on an app level, explaining why the app wants to use this feature.
If the user accepts, ask for permission on a browser level.
If the user declines, dismiss the prompt. Add a setting in your app where the user can activate push notifications in the future should they change their mind.
This is a great article explaining the importance of carefully designing your UX if you want to use push notifications for your web app.