I’m using a leaderboard service called Scoreoid and everything works fine when I’m in Unity but once I build to a Windows Store application and try to run it in Visual Studio, I get an error everytime I try to get any data using WWWForm. I have the Internet(Client) and Internet(Client & Server) capabilities enabled in the project. Here is the code that is throwing the error.
public void getBestScores()
{
/* API method */
string url = "https://api.scoreoid.com/v1/getScores";
/* Unity WWW Class used for HTTP Request */
WWWForm form = new WWWForm();
form.AddField("api_key", "apiKeyGoesHere");
form.AddField("game_id", "GameIDGoesHere");
form.AddField("response", "json");
form.AddField("order_by", "score");
form.AddField("order", "desc");
form.AddField("limit", "15");
form.AddField("platform", "Windows 8");
WWW www = new WWW(url, form);
StartCoroutine(WaitForRequestGetBestScores(www));
}
IEnumerator WaitForRequestGetBestScores(WWW www)
{
yield return www;
/* Check for errors */
if (www.error == null)
{
var data = JsonConvert.DeserializeObject<getBestScoresData[]>(www.text);
int num = 1;
foreach (getBestScoresData item in data)
{
scores.text += num.ToString() + ". " + item.Player.username + " - " + item.Score.score + "
";
num++;
}
}
else
{
Debug.Log("WWW Error: " + www.error);
scores.text = “Error Retrieving Scores”;
}
}
The exact error text I’m getting is “Error while opening ‘https://api.scoreoid.com/v1/getScores’ - Operation has failed with error 0x800c0008: The download of the specified resource has failed.”
Thanks for any help anyone can give.