1 Answer
- Newest
- Most votes
- Most comments
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
- Go to SNS console and open the platform application.
- Select the endpoint and choose “Publish message”.
- Select “Custom payload for each delivery protocol” and add the above message body.
answered 2 months ago
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago