I absolutely broke my head. I have code which send SNS (AWS) for iOS with line:
PublishRequest publishRequest = new PublishRequest("arn:aws:sns:us-east-1:my:topic", messageBody);
and it works fine when I pass there Json like this:
{"message": "ldjldkjlk"}
But of course I need sound to my notification and nothing is works for me. I tried with Json which works when I pass it to SNS GUI, something like that:
{"message": {
"default": "HERE IS AN ALERT, BADGE, and SOUND",
"APNS_SANDBOX": "{\"aps\": {\"alert\":\"HERE IS AN ALERT, BADGE, and SOUND!\",\"badge\": 1,\"sound\":\"bingbong.aiff\"}}"
}}
But I get error:
{"timestamp":1435334944602,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"Could not read JSON: Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: java.io.PushbackInputStream@2db14d22; line: 1, column: 15]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: java.io.PushbackInputStream@2db14d22; line: 1, column: 15]","path":"/sns/send"}
What did they do with PublishRequest? What I should pass there? It will be amazing if somebody helps me!
Aucun commentaire:
Enregistrer un commentaire