Amazon SNS に MessageStructure: json で、Message に JSON いれると、
Invalid parameter: JSON must contain an entry for 'default' or 'APNS'.
などと言われる。APNS のキーはあるのに。。。
よくドキュメントをみると
サンプル:
{
"default": "This is the default message which must be present when publishing a message to a topic. The default message will only be used if a message is not present for
one of the notification platforms.",
"APNS": "{\"aps\":{\"alert\": \"Check out these awesome deals!\",\"url\":\"www.amazon.com\"} }",
"GCM":"{\"data\":{\"message\":\"Check out these awesome deals!\",\"url\":\"www.amazon.com\"}}",
"ADM": "{ \"data\": { \"message\": \"Check out these awesome deals!\",\"url\":\"www.amazon.com\" }}"
}
・・・各キーのvalueがエスケープされてる!\(^o^)/
つまり、
to_json( { APNS => to_json({ aps => { alert => "hoge" } } ) } );
だ!
(^q^)