I want to build a json like this:
...
"conditions": [
[
"Language",
"IN",
[
"en"
]
]
]
...
I am using this code:
new JProperty("conditions", new JArray(new JArray((new JArray("Language", "IN", new JArray(IsEnglish ? "en" : "es"))))))
But this one built me a json with one less array.
"conditions":
[
"Language",
"IN",
[
"en"
]
]
I tried to nest this into another JArray but that is not working. Please suggest.
EDIT: This is the whole Json making statement
JObject json = new JObject(
new JProperty("application", pwApplication),
new JProperty("auth", pwAuth),
new JProperty("notifications",
new JArray(
new JObject(
new JProperty("send_date", "now"),
new JProperty("content", new JObject(new JProperty("en", pushContentEnglish), new JProperty("es", pushContentSpanish))),
new JProperty("ios_badges", 0),
new JProperty("data", new JObject(new JProperty("custom", new JObject(new JProperty("t", notificationType), new JProperty("i", objectId))))),
new JProperty("devices", new JArray(strDeviceArray)),
new JProperty("conditions", new JArray(new JArray((new JArray("Language", "IN", new JArray(IsEnglish ? "en" : "es")))))
)))));