Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase cloud messaging authorizion error

i am trying to send FCM push notification to my android app on from postman i have on my developer console two api keys when i try to use the first one i get this response from FCM :

Unauthorized

Error 401

and when i try the second one i get this response from FCM :

Error=MissingRegistration

request image

and i have this data in the body :

{ "data":{
"score":"5x1",
"time":"15:10"
}
,
"to":"*******"
}

the token is working fine and i have test it in the firebase console what the problem could be and what is the solution

like image 350
Osama Raddad Avatar asked May 13 '26 05:05

Osama Raddad


1 Answers

Error 401 Unauthorized comes beacuse of wrong server key.

To solve this error:
Go to your project settings in firebase console.
Click on Cloud Messaging and copy Server Key mentioned in that page.

Let me know, if more help is required.

like image 154
Dhruv Avatar answered May 14 '26 18:05

Dhruv