Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push notification facility for mobile web app [closed]

I have a simple scenario, to receive notification on mobile devices whenever it's generated from Server.

I know this facility is available in native iOS app and Android but I am trying to avoid native path. What I would like that:

  1. A mobile web app which can be access by visiting a URL
  2. User have ability to create a bookmark on Home screen so that it gets feeling of native app Icon.
  3. Getting badges of notification(no of messages in round shape)
  4. Able to receive notification even if browser is closed.

I know there is a possibility of server side events/Web Sockets but can a web app emulate push notification features?

like image 604
Volatil3 Avatar asked Feb 06 '12 05:02

Volatil3


People also ask

Does web push notification work when browser is closed?

This means the browser can have no windows open, and you'll still receive the push message in your service worker, because the browser in running in the background. The only time a push won't be received is when the browser is completely closed, i.e. not running at all (no marking).

Do web push notifications work on mobile?

The web push channel is already supported by Android mobile devices, and it's in the works for iOS devices. Some browsers that currently support mobile push notifications include Chrome and Firefox on OS, Windows, OS X, Safari on OS X, and more.

Does an app need to be open for push notifications?

The basics of push notifications A push notification is delivered instantly to a mobile device, regardless of whether the device is locked or unlocked. The push notification is delivered even if the user is in a different app or away from the app sending the push notification.

Do push notifications work when app is closed iOS?

Apple does not offer a way to handle a notification that arrives when your app is closed (i.e. when the user has fully quit the application or the OS had decided to kill it while it is in the background). If this happens, the only way to handle the notification is to wait until it is opened by the user.


3 Answers

You can do this without a hybrid app, native app, or requiring users to install Pushover. It is possible to build a "progressive web app" that can send push notifications even after the page has been closed.

These work today in Chrome for Android (and other browsers seem to be implementing support), but there is no support on iOS.

Check out this demo, and this guide explains how to do it: https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/

like image 163
owencm Avatar answered Oct 17 '22 08:10

owencm


as mentioned in Can a Webbased app have push notification? you might try Pushover: Simple Mobile Notifications for Android and iOS.

like image 7
Kai Carver Avatar answered Oct 17 '22 07:10

Kai Carver


Able to receive notification even if browser is closed.

You cannot use WebSockets for this. You must use the more recent Push API. Currently it is supported by all major browsers, except Safari on iOS.

However adding support for the Push API from scratch is a lot of work: I suggest to use a third party service like Pushpad (I am the founder).

like image 2
collimarco Avatar answered Oct 17 '22 09:10

collimarco