Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are push notifications possible in html5 without fully https site?

Looks like Push notifications are finally usable for web-apps! Unfortunately, this requires https for ServiceWorker, which not all sites may have.

One thing I noticed in the spec it mentions:

if r's url's scheme is not one of "http" and "https", then: Throw a TypeError."

So I'm confused - can the site be http, as long as it includes a serviceworker that is from https? For example, mydomain.com could include an https serviceworker from https://anotherdomain.com?

Another standard, web-api simple-push, doesn't mention requiring https (likely an omission in the documentation?), and "The user experience on Firefox Desktop has not been drawn out yet". Is the documentation on this outdated, or is push really only supported in FirefoxOS??

like image 296
NoBugs Avatar asked May 30 '15 04:05

NoBugs


People also ask

What are the limitations of push notifications?

A basic notification includes a title, some text, an icon, and a link. A title can contain up to 65 characters, a description is generally limited to 240 characters.

Are push notifications HTTP?

Web push. The Web push proposal of the Internet Engineering Task Force is a simple protocol using HTTP version 2 to deliver real time events, such as incoming calls or messages, which can be delivered (or “pushed”) in a timely fashion.

What is the protocol for push notification?

There are two protocols http and xmpp which you can use to send message to GCM server. Now its up to you what you want to use. If you want to broadcast message then u should go with http.

Does web push notification work when browser is closed?

The answer is “no” when we are talking about desktop devices like laptops and PCs. However, you can receive browser push notifications on your mobile device without opening your browser app. The only requirement to receive a push is an unlocked screen and an installed and activated browser app like Chrome.


2 Answers

Simple-push, that is the current push solution in Firefox OS doesn't have anything to do with ServiceWorkers.

The next generation of push, implemented by both Google and Mozilla will be done through ServiceWorkers:

  • Push API spec

In that case yes, your content will need to be served over HTTPS.

Probably you will be interested in the LetsEncrypt initiative:

  • letsencrypt.org

A new certification authority that will help developers to transition their content over HTTPS.

Also just for development purposes, both Google and Mozilla implementations of ServiceWorkers allow you to bypass the check of the secure content, if you develop against localhost. In the case of Mozilla you will need to enable the flag:

devtools.serviceWorkers.testing.enabled: true

But again this will be just for development, and AFAIK, Mozilla push landed or is about to land, and will be available in the nightly builds, you can follow the work here:

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1038811
like image 94
Francisco Jordano Avatar answered Oct 21 '22 18:10

Francisco Jordano


No, the new generation of push notifications (i.e. Push API) requires HTTPS.

If you need to add push notifications to a website without HTTPS you can use a third-party service like Pushpad (I am the founder) that delivers notifications on your behalf.

like image 39
collimarco Avatar answered Oct 21 '22 16:10

collimarco