MatthieuLemoine / electron-push-receiver

A module to bring Web Push support to Electron allowing it to receive notifications from Firebase Cloud Messaging (FCM).
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
194 stars 64 forks source link

GCM register has failed #32

Closed tom-s closed 6 years ago

tom-s commented 6 years ago

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 ?

tom-s commented 6 years ago

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/

MatthieuLemoine commented 6 years ago

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

tom-s commented 6 years ago

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

MatthieuLemoine commented 6 years ago

@tom-s a fix has been released https://github.com/MatthieuLemoine/push-receiver/releases/tag/v2.0.1