Skip to content

SNS with GMC V1 payload error

0

Hi, i migrate to GMC V1 when try to send a test the backend respond ok, but recived a DeliveryAttempts failure with this error

"EventType":"DeliveryFailure","FailureMessage":"Notification body is invalid","FailureType":"InvalidNotification"

I check the json and seems ok, any ideas

Thanks

2 Answers
0

The error message "Notification body is invalid" typically occurs when the payload you're sending is not properly formatted according to the Firebase Cloud Messaging (FCM) protocol.

Here's the correct format for sending a notification to FCM via AWS SNS:

{
  "GCM": "{\"notification\":{\"body\":\"This is a notification message for FCM!\",\"title\":\"FCM Message\"}}"
}

If you want to send data payload instead of a notification, you can use the following format:

{
  "GCM": "{\"data\":{\"message\":\"This is a data message for FCM!\"}}"
}

Test the setup

  1. Go to SNS console and open the platform application.
  2. Select the endpoint and choose “Publish message”.
  3. Select “Custom payload for each delivery protocol” and add the above message body.
AWS
EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
0

Hi, thanks for the response, yes with this payload response ok but the push not delivered and the log sends "EventType":"DeliveryFailure","FailureMessage":"Notification body is invalid","FailureType":"InvalidNotification".

I created a new plattorm and with same json works fine, i think is for the migration to new FCM. The problem is all token register in the old platform.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.