Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase 401 unauthorized error FCM

I'm trying to test out Firebase Cloud messaging APIs as all functionality is not available from console (notably customization of notifications when app is in background). But for some reasons, I cannot get it to work, and it always shows up 401 error. I investigated the reasons for this, and tried it after regenerating new server key, but the error remains constant. Surprisingly, when I generated a new server key, it is not reflected in Firebase console and it shows server key as empty. Also, I tried adding my IP address to the server whitelist IPs but still no luck. I've attached a screenshot of a request that I did with Postman (I substitue the server key in place of serverKey.

I'm stuck on this for a few hours and would really appreciate some help.enter image description here

like image 749
gaurav jain Avatar asked Jun 04 '16 17:06

gaurav jain


People also ask

Is there any limit for FCM?

For Android, you can send up to 240 messages/minute and 5,000 messages/hour to a single device.


1 Answers

I don't know if someone uses the [Web API Key] as the [YOUR_SERVER_KEY] for POSTMAN test and keep getting '401 Error'. [Web API Key] is not [YOUR_SERVER_KEY].

You should go to your Firebase console and check this:

to get the correct Server key.

Hope it help.

like image 131
S1ngoooor Avatar answered Oct 12 '22 23:10

S1ngoooor