I'm new to all iOS push notification domain. I have tried a basic push notification using the following code and it works perfectly. I'm using "using JdSoft.Apple.Apns.Notifications;" to accomplish this. Here's the code:
Notification alertNotification = new Notification(testDeviceToken);
alertNotification.Payload.Alert.Body = "Hello World";
alertNotification.Payload.Sound = "default";
alertNotification.Payload.Badge = 1;
This gives the output to the iPhone in the following structure:
{
aps = {
alert = "Hello World";
badge = 1;
sound = default;
};
}
I have now got the requirement to add a custom tag as follows:
{
"aps": {
"alert": "Hello World",
"sound": "default",
"Person": {
"Address": "this is a test address",
"Name": "First Name",
"Number": "023232323233"
}
}
}
I find it difficult to get "Person" inside "aps". I also know that you can add a custom attribute using the following code:
alertNotification.Payload.AddCustom("Person", Newtonsoft.Json.JsonConvert.SerializeObject(stat));
But the above code does not add withing "aps" tag. Please tell me how it can be achieved?