We follow this guide: How to: Windows Azure Notification Hubs (Android apps) for Android.
Everything works fine when structuring the notification payload, as described in the manual. I.e:
{
"data": {
"msg": "$(property1)"
}
}
However, we would like to expand the template to use more than one custom property in the payload. Sort of:
{
"data": {
"msg": {
"message": "$(property1)",
"sender": "$(property2)"
}
}
}
where the back-end provides property values through:
Dictionary<string, string> templateValues = new Dictionary<string, string>
{
{ "property1", "Hello world" },
{ "property2", "foo" }
};
NotificationOutcome notificationOutcome = await Hub.SendTemplateNotificationAsync(templateValues, "test");
When registering a template in the notification center from a mobile application, we get the following error:
"The supplied notification payload is invalid"
- Can I use multiple templates in a template?
- ( ) JSON ( )? ? (iOS, Android).