I've connected an Android app to Google Firebase Cloud Messaging service (FCM) following this guide,
and I've followed this answer to setup the connection between FCM & AWS SNS.
I could successfully receive message sent from FCM console but not from AWS SNS console.
The message delivery status logged on AWS showed SUCCESS for every message I've sent while no notification was shown on my device.
Is there a way to check what's going on?
Simply using this JSON format:
{
"GCM": "{ \"notification\": { \"body\": \"Sample message for Android endpoints\",\"title\": \"Sample message for Android endpoints\"}}"
}
I faced the exactly the same problem, message from Firebase with device token works but somehow message from SNS to Firebase is not delivered.
I did develop iOS app as well, and at that moment, just sending "brabra" delivered message to iOS. However, FCM only accepts particular message format to test it from AWS SNS console.
Here is the example format of successful delivery of message to Android through SNS and FCM.
{
"GCM": "{\"notification\": { \"body\": \"Sample message for Android endpoints\", \"title\":\"Hello world\" } }"
}
The point is that we have to amend to "notification", not "data", and should have body and title in the notification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With