MatthieuLemoine / electron-push-receiver

A module to bring Web Push support to Electron allowing it to receive notifications from Firebase Cloud Messaging (FCM).

Home Page:https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GCM register has failed

tom-s opened this issue · comments

Hi I have the same issue a few people had before, I get a PHONE_REGISTRATION_ERROR when building and running my desktop app with electron-builder. I use webpack and copy the proto files with CopyWebPackPlugin when building. It works perfectly in my dev (localhost) environment, but when i package the app with electron-builder and run it I get a "GCM register has failed" error (which is more specifically a "Error=PHONE_REGISTRATION_ERROR"). The proto files are included in the asar file and loaded successfully (I've checked putting logs in my node modules). So the problem comes from elsewhere but I can't figure it out. Would you have any ideas ?

Might not be of any use but here is a comparison of logs the requests going on both cases (my working localhost on the left, and the non working built on the right side): http://www.mergely.com/D0yFktuh/

It's weird that it's only failing when packaged with electron-builder but it's not proto related 😕 I don't know how electron-builder works but I think that except for file paths everything should work the same

We found the cause and a workaround, I'll post an issue/PR in push-receiver because that's where the bug comes from.