Sending a simple text notification is simple and well-documented. But today, I pulled my hair for sending a custom notification for iOS that has a warning, and some fields like userId.
I started from this help page and implemented something similar to the last sample, then I found this answer , which seems to nullify the last sample on the help page, since the url property must be outside the aps object. I tried many combinations, but each of them is sent as text to the application (the whole message with the property "default" and "APNS") ...
If I explicitly set the MessageStructure to json, I get the error: "Invalid parameter: Message Structure - the body of the JSON message could not be parsed," but I'm sure my JSON is good when sending SNS in a line in the Message property looks like this:
{ "default":"You received a new message from X.",
"APNS_SANDBOX":"{ \"aps\": {\"alert\":\"You received a new message from X.\"},
\"event\":\"Message\",
\"objectID\":\"7a39d9f4-2c3f-43d5-97e0-914c4a117cee\"
}",
"APNS":"{ \"aps\": {\"alert\":\"You received a new message from X.\"},
\"event\":\"Message\",
\"objectID\":\"7a39d9f4-2c3f-43d5-97e0-914c4a117cee\"
}"
}
Does anyone have a good example of sending custom payload notifications via SNS in C #? Because Amazon is sure not ... Thank you!
source
share