I am trying to get the Firebase Cloud Messaging to work. I am just trying a test for now. What I have done is everything in this post:
Then at that end you see this:
messaging.getToken().then((currentToken) => {
I then copy this currentToken
and use it as a test by going to Firebase (the website) > Grow (sidebar) > Cloud Messaging (sidebar) > Send your first message (button) > Fill in a 'Notification title' and 'Notification text' > Send test message (blue button to right) > Add the currentToken
I copied from above OR check a previously added one > Test (button) ... (see screenshot below)
I assume after clicking the 'Test' button it should send a notification to my phone (where I allow notifications and got the token from). I tested this with my pc and did not get a response either. Using Chrome on my pc and laptop for what that matters.
What am I missing here?
I was missing an important part of adding the gcm_sender_id
in the manifest.json
. I followed this link exactly and it worked perfectly. You can use the Firebase Cloud Messaging testing platform instead of the Postman approach from the article: