Quantcast
Channel: Latest Questions by SimonW
Viewing all articles
Browse latest Browse all 12

WWW class is empty on iOS

$
0
0
I have some networking code using Unity's WWW class that reads data from a remote server. It works fine in the editor, but when I try it from an iPad the www object is completely empty - no headers, no error, nothing. Here's a stripped down version of what I'm doing: WWW www; public void StartLogin (string username, string password) { WWWForm form = new WWWForm(); form.AddField("username", username); Hashtable headers = form.headers; headers["username"] = username; headers["password"] = password; headers["deviceId"] = 2; www = new WWW(loginUrl, form.data, headers); //StartCoroutine(WaitForLoginRequest()); } void Update() { if (www != null && www.isDone) { DoLoginRequest(); } } void DoLoginRequest() { //Code goes here www = null; } As you can see, I started using coroutines, but switched over to a simpler version using Update (didn't help). I know the connection is getting through to the server because it's logging an error 412 - I can fix that, but I'm more worried about where all my information is going on the iOS side.

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images