- Home /
It's not Unity it's my darn network.
WWW Post (Form) not working on mobile.
I've copied this very simple example. https://docs.unity3d.com/ScriptReference/WWWForm.html
Now, when testing on my iPhone 6 & Nexus 5 both of them fail to make a request.
On Android I get:
Request error: java.net.ConnectException: failed to connect to /192.168.0.50 (port 50122): connect failed: EHOSTUNREACH (No route to host)
On the iPhone I get nothing but no connection.
This works for desktops (Mac). This works for Android but only once (after turning WiFi on and off again. Not viable)
Here is my sample code:
// From some request StartCoroutine(ProcessRequest
public IEnumerator ProcessRequest() { WWWForm form = new WWWForm(); form.AddField("data", jsonData);
WWW request = new WWW(url, form);
yield return request;
// Do some stuff.
}
Answer by Bunny83 · Jun 27, 2016 at 01:29 PM
Uhm the error is "host unreachable", so it's most likely your URL that's wrong. How does it look like? Do you use a proper protocol / scheme? Do you use a custom port? What kind of server you want to connect to?
Thanks I figured it out.
When using the Unity WWW class the router blocks my $$anonymous$$acbook internally. I have to manually renew the lease in order to get it working again.