Android notifications not working when sent via Amazon SNS
We send messages via Amazon SNS and Google Cloud Messaging (GCM) to an Android device. This is the original SNS json message that we enter into the SNS messaging function:
{
"GCM": "{\"data\":{\"someData\":62},\"notification\":{\"body\":\"Body message\",\"title\":\"A Title\"}}",
"default": "My default message"
}
For some reason, the section "Notice" with him title
, and body
seems to ignore. No notification appears on the device.
Is it possible to confirm that notifications can be sent via SNS or is there (as we suspect) some kind of limitation where only the data{...}
json part is understood ?
source to share
Notifications will not appear in the tray if the app is running in the foreground. However, the data must be available. Here are the docs: https://developers.google.com/cloud-messaging/concept-options#notifications_and_data_messages
source to share