Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Messaging: REST API responds with "INVALID_KEY"

Our push notifications work fine with the in-built tester on the firebase console website.

However when we try to use Postman to simulate a push request to fire off "our own" notification the server always returns "INVALID_KEY" Error 401.

Where is the correct Key located? So far we tested:

  • Web Push public key (green are in the following image)
  • Web Push private key (located in the options menu in near the green area in the image)

firebase console settings

When using these keys in Postman (plus the required body) the previosly mentioned error is returned:

postman setup

What are we doing wrong? Do we need a completely different key? Thanks in advance!

like image 377
AdaLollA Avatar asked Nov 23 '25 17:11

AdaLollA


1 Answers

Found the solution: you have to create a Legacy Setup of the Cloud Messaging API under Project Settings > Cloud Messaging.

To do so press the three dots next to "Cloud Messaging API (Legacy)" and enable the service. It then automatically sets up the environment and present the key.

like image 134
AdaLollA Avatar answered Nov 27 '25 05:11

AdaLollA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!