On some browsers, the permission prompt for notifications can be displayed only after a user interaction with the website. Let’s see why some browsers enforce this rule, what happens if you don’t comply with it and how can you implement a solution that works across all major browsers.
Chrome 84 will fight abusive notifications. Let’s see what you should do to stay complaint and avoid the penalization.
Browsing the web, you may have noticed that most websites use a double opt-in process for subscribing the users to notifications. Basically these websites first show a custom prompt (designed with HTML / CSS) that asks you if you are interested in the notifications, then, when you click the subscribe button, they display another prompt (with native appearance) asking you if you really want to allow the notifications from the website. Isn’t one prompt enough?
Are you wondering what is the maximum length of text that you can include in your web notifications?
Why some web push notifications are not delivered to the browser? Why some notifications are not displayed to the user?
A notification that is successfully delivered to the browser push service, may not reach the end user for various reasons:
Would you like to send web push notifications only to people located in a given place? If you use Pushpad you can implement that in different ways.
Usually the prompt for web push notifications is displayed only once, the first time that the user visits a website. What if the user blocks the notifications? Is there a way to show the notifications prompt when the user visits the website again?
There are various reasons that can prevent a web push notification from being delivered. One of them is the presence of subscriptions that are no longer in use:
Forcing the user to subscribe to push notifications is probably not a good choice for most websites. However there are some specific situations where it makes sense to do that.
You can change your notification preferences for a website at any time. You can allow or block the notifications using the browser preferences:
Many developers have asked if they can use Pushpad for sending push notifications to their hybrid mobile apps. Basically they want to use the W3C Push API inside a WebView. That would make sense, because a WebView is a sort of browser embedded inside an application.
At the moment Safari on iOS doesn’t support web push notifications.
You can use the Push API to send timely notifications from your website (the notifications are delivered even when the user is not on your website). If you use Pushpad, a service for web push notifications, it is very simple to set the time when the notification must be delivered.
Many issues related to web push notifications can be solved by simply resetting the browser permission. That removes the old browser subscription and creates a new subscription.
A customer has recently asked if they could use SVG images as the notification icon. Unfortunately the answer is no at the moment because of browser support.