Push Support In Electron?


#1

Hey everyone,

I have recently been trying to implement some push notifications in my app through chrome’s cloud messaging service. They have some awesome write-ups online about how to implement this in the chrome browser. I assumed this should work very similar in Electron. So I tested my code in Electron (0.32.2) and unfortunately I keep getting a DOM error stating :

Unable to subscribe to push. DOMException: Registration failed - push service not available

Seems like it makes sense but, when I visit chrome://serviceworker-internals within Electron, it sats my service worker is ACTIVATED and RUNNING.

Also, I have checks within my code to verify that push services and the service worker are ready to go.

After I first received this error I tried running my code within a regular chrome browser and it worked flawlessly. So, that fortifies the fact that Electron doesn’t like something about Google Cloud Messaging.

If anyone could offer any sort of advice on to why Electron is having an issue with this implementation of push notifications, I would greatly appreciate it. Thanks in advance for the help!

-Alec


#2

Try posting this in the electron repo, You’ll get better responses.


#3

Hey steelbrain,

Thanks for the reply! I will definitely go ahead and do that.

-Alec


#4

Hey Alec,

Did you find out more and get GCM working inside electron?

Thanks
-Adam


#5

Hey Adam,

A while back I was informed that GCM is not, and most likely will not be supported within Electron. The reason being is that it is too “heavy”. It would end up making the final file size too large. A work around that I know Slack implemented was to use websockets in order to get push notifications to work. I hope this is helpful!

-Alec


#6

Hi,

I’m facing the same error on Twitter Lite (mobile.twitter.com). Did anyone find out the way to fix it? Is there an issue in electron repo?