Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alert and Notification like Android using Jquery mobile for web app

I want to develop a web app using HTML5, CSS3, JQuery Mobile (so that it should run on all platform).

My requirement is that user should get alert and notification like Android/ios when the user turns ON tab/ipad etc. e.g on the tab if I have Gmail account (or any other email) configured then when I turned on the device I get a notification that I have new unread message in the system bar. Then to see the actual message it take me to the email.

Similarly, I want a notification for my web app, suppose some approval is pending then it should alert the user even though he is not logged into web app.

Can we really achieve system alert and notification for web app using Jquery Mobile?

like image 201
JDev Avatar asked Feb 20 '23 21:02

JDev


2 Answers

Currently there is not an API to access the notification systems on mobile devices from a website. Mozilla is actually working on making that a standard API with their Book to Gecko project: https://wiki.mozilla.org/B2G

If you create native applications that can be downloaded via app stores on devices, then you can push notifications to individual devices that are relative to a user of your application. These are generally called "Push Notifications."

like image 50
Jasper Avatar answered May 01 '23 17:05

Jasper


The short answer is no. A browser application, like all applications on mobile OSs, run in the background in a "paused" state.

Therefore, if the browser was not the front running application the user would not see the notification generated by your web app in the browser. Additionally, your web app would not have access to the OS's features, like the browser would, to create native notifications.

The long answer is you can write a phonegap application as @sachleen suggests that connects to your web service or using message pushing (from the server to the device) to notify the users.

You might look at create something small like a widget who's sole purposes is to poll for messages and notify the user causing the browser to open when clicked.

like image 39
Eonasdan Avatar answered May 01 '23 18:05

Eonasdan