public InstalledApplication[] GetInstalledApplications(string deviceId) { string accessToken = Login(); List <InstalledApplication> installedApps = new List <InstalledApplication>(); Dictionary <string, string> headers = new Dictionary <string, string>(); headers.Add("Authorization", "Bearer " + accessToken); headers.Add("Accept", "application/json"); WWW www = new WWW(_url + string.Format(DeviceApplications, deviceId), null, headers); while (!www.isDone) { } if (!string.IsNullOrEmpty(www.error)) { Debug.Log("Error during getting installed applications." + www.error); } var root = JSON.Parse(www.text); foreach (var applicationNode in root.Childs) { InstalledApplication installedApplication = new InstalledApplication { Name = applicationNode["Name"].Value, ApplicationId = applicationNode["ApplicationId"].Value, DeviceId = applicationNode["DeviceId"].Value, }; installedApps.Add(installedApplication); } return(installedApps.ToArray()); }
public InstalledApplication[] GetInstalledApplications(string deviceId) { string accessToken = Login(); List<InstalledApplication> installedApps = new List<InstalledApplication>(); Dictionary<string, string> headers = new Dictionary<string, string>(); headers.Add("Authorization", "Bearer " + accessToken); headers.Add("Accept", "application/json"); WWW www = new WWW(_url + string.Format(DeviceApplications, deviceId), null, headers); while (!www.isDone) { } if (!string.IsNullOrEmpty(www.error)) { Debug.Log("Error during getting installed applications." + www.error); } var root = JSON.Parse(www.text); foreach (var applicationNode in root.Childs) { InstalledApplication installedApplication = new InstalledApplication { Name = applicationNode["Name"].Value, ApplicationId = applicationNode["ApplicationId"].Value, DeviceId = applicationNode["DeviceId"].Value, }; installedApps.Add(installedApplication); } return installedApps.ToArray(); }