As the web is moving forward very fast and now we can do almost everything on the web which can be done in native applications (android & iOS). Such as offline contents, push notifications, background sync etc.
But many websites started using these features in a bad way and only a few sites are using it in better ways to engage users.
In this post, I will explain why and when you should and shouldn't prompt for push notifications.
first visit (this pattern is repeated in most of the sites)
relevant.After ordering something, prompt the user that you will give order status using push notifications.

permission prompt on every page load.enable push notification for certain categories. Let the user decide whether he/she wants the push notifications.Google I/O 2017 site has options to enable for attendees i/o notifications.

disable the enabled push notifications.disable notifications, so he/she can disable it when no longer needs it.
Chrome
Opera
Mozilla Firefox
Above browsers support push notifications in both desktop & mobile.
As a user just like you, I get irritated whenever I see the push notification prompt on unwanted times and on every page load.
So once the user blocks the permission, there is no way to ask for permission again unless user clears the site cache. So focus on the user and show permission prompt only when it is relevant. Thanks for reading my post. See you in next post :)