When I reloaded my app in Chrome on Android, Chrome suggested to add site onto home screen (as an app). But no question on push notifications was asked. So they don’t work.
In Google cloud console I can’t see any traffic for GCM.
What to check? How to debug? Any help is appreciated.
I have to dump the topic up and tried to ask advice one more time as I really have no idea what to check more.
So I’d narrow the question to: how to check that Discourse tries to send any push notifications?
I setup GCM but I can’t see any incoming activity in its stats, so problems is obvious on my server side, “push notifications” were activated in user settins, tried different browsers (push notifications work fine for meta.discource for me, so the problem is not with the browser/device)
Run this command from your rails console: DiscoursePushNotifications::GCMPusher.push(User.find_by(username: '<your username>'), {})
You should receive a push notification almost immediately. If not, it’ll indicate that the configurations for google cloud messaging might be incorrect.
So I migrated my GCM project to Firebase, and tried using new server key (longer)
(https://console.firebase.google.com/project//settings/cloudmessaging)
But it changed nothing.
No (
(tried two accounts and desktop and Android)
Right after I recreated GCM app and re-run the code I got some different result:
I came into GCM again and noticed that now I have not only API key but also Server Key. Probably it’s after I migrated my app to Firebase.
I used the server key and finally it starts working.
So the manual is outdated and the warning in the docs makes sense. For push notifications to work we need server key which cannot be created in https://console.developers.google.com/apis/ anymore.
Instead we have to use https://console.firebase.google.com/
BTW: there’re two server keys there: long (“Server key”) and short (“legacy server key”). For GCM we need the legacy one.
(I previously tried the long one)
also after some time of celebrating it stops working again All I did as I can remember - edited credentials (restrictions/name), rolling back, creating new credentials (in Firebase) and a new project in Firebase didn’t help.
For several days I’ve been trying to make the plugin work without success. I’ve followed the very outdated guide, then I’ve discovered exactly what @Shrike found out. But it just doesn’t work.
I’ve tried creating a new project, but that is not helping either.
I deleted everything, uninstalled the plugin, re-installed it again, nothing.
Even though the settings are correct (Organization ID + legacy server key entered in settings) I get the following error in the console when pressing the push notifications button on my profile:
Registration failed - missing applicationServerKey, and manifest empty or missing
Also, button dissapeared on Firefox browsers ¯_(ツ)_/¯