Manu
Manu

Reputation: 63

Google FCM Request

I'm working on the Google FCM message service. I deploy my API with my server it's working fine. But when I do the same within Client Production Service it gives me 401 error.

I'm running Window Service and hitting Restful API. I validate each and everything within Google account also but not able to rectify the same.

Upvotes: 0

Views: 81

Answers (1)

Julian
Julian

Reputation: 3869

I've recently the same problem. I implemented everything right with all parameters. Finally I found the solution. I used the API Key from Google developer console and not from firebase. So go to the following url: https://console.firebase.google.com/project/YOUR_PROJECT_ID/settings/cloudmessaging/

Cloud Messaging Settings

There you can see two API keys. Choose the longer top server key.

After I replaced the key in the header Authorization: key=YOUR_KEY, it finally works.

Upvotes: 1

Related Questions