A web push notification is a message that a website can send to a user’s device (desktop or mobile) even when the website is not open in a browser.
Key Features:
- Real-time: Delivered instantly or at scheduled times.
- Requires permission: Users must grant permission before receiving notifications.
- Works outside browser: Once permission is granted, messages can be sent and received even if the site is closed.
- Platform-independent: Supported by most modern browsers like Chrome, Firefox, Edge, and Safari (with limitations).
How it Works:
- User visits a website.
- The site asks for notification permission via the browser.
- If granted, the website registers a Service Worker in the browser.
- The site sends a message to a push service (like Firebase or VAPID-based servers).
- The push service delivers the notification to the user’s device via the browser.
What it Looks Like:
It typically shows as a small pop-up (like a toast notification) in the corner of a desktop screen or as a standard push notification on mobile devices.
Use Cases:
- News updates
- Promotions or discounts
- Reminders or alerts (e.g., “You left something in your cart”)
- Social media or messaging alerts