using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public static class PushwooshUtils
{
///
/// Parses json object and returns dictionary representation of json
///
/// dictionary
/// Thrown if json has bad format or it is not JSONObject
/// JSON
public static IDictionary JsonToDictionary(string json)
{
PushwooshJSON.JSONObject jsonObject = PushwooshJSON.JSON.Parse(json) as PushwooshJSON.JSONObject;
return JsonObjectToDictionary (jsonObject);
}
private static IDictionary JsonObjectToDictionary(PushwooshJSON.JSONObject jsonObject)
{
var result = new Dictionary ();
foreach (KeyValuePair pair in jsonObject) {
string key = pair.Key;
PushwooshJSON.JSONNode value = pair.Value;
result.Add (key, JsonNodeToPOCO (value));
}
return result;
}
private static List