cordova-plugin-fcm ERROR : invalid api key

2019-05-04 17:27发布

问题:

I am using cordova-plugin-fcm. I have followed the installation instruction:

  1. install plugin
  2. add the google-services.json to my root folder

I wanted to test it through their testing server, but I get the error:

ERROR: invalid api key 

The key I inserted was the one from the file google-service.json in the entry:

"api_key": [{"current_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}]

How can I do the testing properly?

回答1:

When using FCM, you should always make use of the Server Key seen in the Cloud Messaging Tab in your Firebase Console.