I'm trying to send a notification that contains custom data (the aim being to trigger functionality on the mobile device), based on the details published here: http://docs.telerik.com/platform/backend-services/development/rest-api/push-notifications/sending-notifications
Here's an example of the JSON that I'm sending to the REST interface at http://api.everlive.com/v1/my_telerik_key/Push/Notifications
{
"Filter": "{ "$or": [ { "HardwareId": "e010101036515BCB691C41BB97899D49BEC8DBC8" } ]}",
"Android": {
"data": {
"title": "Test Title",
"message": "Test Message",
"customData": "{ "uid": 0, "pid": 1148, "act": "test", "data": { "foo": "bar", "sentAt": "2015-05-07T16:17:50.219599Z" }}"
}
},
"IOS": {
"aps": {
"alert": "Test Title: Test Message",
"sound": "default",
"category": "MyApp"
}
},
"WindowsPhone": {
"Toast": {
"Title": "Test Title",
"Message": "Test Message"
}
}
}
This works fine (Response is HTTP 200 - Success) and the custom data is received by Android devices.
Extending this out to send the custom data to iOS and Windows mobiles, I've come across two problems:
1) Adding a customData element to the iOS element causes the telerik servers to respond with HTTP 400 - Bad Request. Here's the relevant JSON excerpt:
"IOS": {
"aps": {
"alert": "Test Title: Test Message",
"sound": "default",
"category": "MyApp"
},
"customData": "{ "uid": 0, "pid": 1148, "act": "test", "data": { "foo": "bar", "sentAt": "2015-05-07T16:17:50.219599Z" }}"
},
2) The documentation (http://docs.telerik.com/platform/backend-services/features/push-notifications/structure) doesn't seem to specify a means of adding custom data to notifications targeted at Windows mobiles. Can the Telerik Back-End send custom data to windows devices? If so, how?
Thanks for any help you can provide.