I have configured push notifications on Parse-Server & in Android app. But I am not able receive push notifications in a website using Parse JS SDK. They don't provide any method to subscribe for push notifications in ther JS APIs. There Documentation (JS) only talks about subscribing to mobile devices not browsers.
SUBSCRIBING TO CHANNELS
The JavaScript SDK does not currently support subscribing iOS and Android devices for pushes. Take a look at the iOS, Android or REST Push guide using the platform toggle at the top.
So, I concluded that web browsers can't subscribe just by using Parse JS SDK? So, how should I subscribe & receive Push notifications on a web browser from Parse Backend?
Update:
I haven't test but If I use ServiceWorker
to get subscription & subscribe user to some channel, can I use the default Parse Class Installation
for saving subscription & then use that (web) Installation in Cloud Code to send Push?
I have tested it and got achieved desired results via following. As Jake said, for web there are no Installations in Parse. So, in order to receive push notifications on the web, you have to
pushSubscription
and hande push
, click
events etc.pushSubscription
to server. It will be used to send pushes to Web.web-push
if you want.Further, the Installation
class cannot be used for web pushes.