Search code examples
cordovafirebasepush-notificationcordova-pluginsfirebase-cloud-messaging

cordova-plugin-fcm ERROR : invalid api key


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?


Solution

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