Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App connected to FCM not receiving notification from AWS SNS

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?

like image 313
bluenowhere Avatar asked Dec 02 '16 05:12

bluenowhere


2 Answers

Simply using this JSON format:

{
  "GCM": "{ \"notification\": { \"body\": \"Sample message for Android endpoints\",\"title\": \"Sample message for Android endpoints\"}}"
}
like image 170
Hariom Maurya Avatar answered Oct 26 '22 13:10

Hariom Maurya


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.

like image 31
Yuki Tanaka Avatar answered Oct 26 '22 13:10

Yuki Tanaka