By default payload
{"aps":{"alert":"Message","badge":1,"sound":"default"}}
with this i need to add one more array object in c# how i can add that
i need the output like this
{"aps":{"alert":"Message","badge":1,"sound":"default"},"Vi":{"id":1,"name":"raj","pp":"Need to talk"}}
I am trying like this below code
object[] objc = {new
{
id = 1,
nm = "raj",
pp = "visit"
}};
string msgData = new JavaScriptSerializer().Serialize(objc);
string[] resultArray = Array.ConvertAll(objc, x => x.ToString()).ToArray();
payload1.CustomItems.Add("Vi", resultArray())
the output i am getting is like this below but in that the array object it come with quotes
{"aps":{"alert":"Message","badge":1,"sound":"default"},"Vi":"{ id = 1, nm = raj, pp = visit }"}
By default payload {"aps":{"alert":"Message","badge":1,"sound":"default"}}
with this i need to add one more array object in c# how i can add that i need the output like this {"aps":{"alert":"Message","badge":1,"sound":"default"},"Vi":{"id":1,"name":"raj","pp":"Need to talk"}}
I am trying like this below code
object[] objc = {new { id = 1, nm = "raj", pp = "visit" }}; string msgData = new JavaScriptSerializer().Serialize(objc); string[] resultArray = Array.ConvertAll(objc, x => x.ToString()).ToArray();
payload1.CustomItems.Add("Vi", resultArray())
the output i am getting is like this below but in that the array object it come with quotes {"aps":{"alert":"Message","badge":1,"sound":"default"},"Vi":"{ id = 1, nm = raj, pp = visit }"}
so i need a output like this
{"aps":{"alert":"Message","badge":1,"sound":"default"},"Vi":{ "id" : 1, "nm" :"raj", "pp" : "visit" }}