Amazon SNS: "Platform Credentials Invalid" When Re-Entering GCM API Key That Previously Worked

We have been using Amazon SNS to send Android push notifications since April this year.

Push messages were sent without any problems, but there was never a record of Cloud Messaging API calls in the Cloud Console (seems odd?).

Today I created a new API key for the static map service (unrelated) and renamed our Cloud Messaging API key (only the name, the key is the same). From that moment, no clicks were sent and an attempt to create a new platform application (or update an existing one) in the AWS results:

Invalid parameter: Attributes Reason: platform credentials are invalid (Service: AmazonSNS; Status code: 400; Error code: InvalidParameter; Request identifier :)

I also tried manually making calls to https://gcm-http.googleapis.com/gcm/send using a key that leads to unauthorized (401).

Interestingly, I can make calls to the above endpoint using the key I created today, however they do not work with MismatchSenderId.

I do not see many previous parameters that the cloud console had (server / browser keys, etc.) in the API manager?

+8
amazon-web-services google-cloud-messaging
source share
4 answers

API Key Management for GCM has been moved to the Firebase Console. You can create a new Firebase project (or import an existing cloud project), and you should get a new server key for cloud messaging.

see updated documentation:
https://developers.google.com/cloud-messaging/android/client#create-an-api-project
and question: Where can I find the API for Firebase Cloud Messaging?

If you still have problems, please contact:
https://firebase.google.com/support/contact/troubleshooting

+10
source share

For those who come across this in 2017, here's a tip:

1 - Go to the firebase console ( https://console.firebase.google.com/ ) click on your project (which you want to use for push notifications)

2 - Click the "three dots" on the right side of your project name and click "Settings"

3 - Click "CLOSE MESSAGE" on the header tabs

4 - Copy the "Server Key" (this file is larger than your API key)

5 - Insert the AWS API Key tab for Create Platform Application

PS: Please note that this is only valid for GCM Push notifications.

+14
source share

For those who are starting a new project and wondering why it is still not valid, make sure that the Key restriction application is set to Android apps . In my case, it was installed only on None , and when I switched to Android applications, it worked after 5-10 minutes after updating it. You will need to add the name of your package and the SHA-1 certificate thumbprint.

+1
source share

I get the same error when creating an Amazon SNS platform application:

 Invalid parameter: Attributes Reason: Platform credentials are invalid (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID:) 

After referring to the Firebase support offered by Diego, this is the answer I received from Google:

I hope you are doing well, and thank you for contacting us.

I am not very familiar with Amazon SNS and it looks like their integration is still related to GCM, not FCM. If your application implementation is still GCM, you need to migrate using FCM to use the server key in the console. See instructions here .

In addition, Firebase upgraded server keys to a new version. We recommend using the server key instead of the old server key.

Hope this helps. Let me know if you have any other problems. Thanks.

This means that we will need to change our application code. We were able to do this work for another application in the organization by creating a new firebase project and using the Legacy server key with Amazon SNS.

At some point, we will definitely switch to using FCM, but at the moment we have a limited time.

Update: So, finally, what worked for us is using the "Server Key" in the "Project Settings" - "Cloud Messages" section. The application still uses the GCM implementation. Amazon SNS is pleased with this key and has created an application for the GCM platform platform. Working! It is still confusing why the "Legacy Server Key" does not work for one application, but is suitable for another. But I don't dig into that anymore.

+1
source share

All Articles