- Home /
[Android] WWW and Basic Authentication
The combination of WWW.LoadFromCacheOrDownload and basic authentication does not work in Android, but in iOS.
I want to use WWW.LoadFromCacheOrDownload to download a basic authentication URL as follows:
WWW www = WWW.LoadFromCacheOrDownload("http://username:password@myURL.com/assetbundle.unity3d", version);
This works in iOS but not in Android. I don't know why.
If I change to using WWWForm, it works in both Android and iOS, but I could not use LoadFromCacheOrDownload feature: WWWForm form = new WWWForm(); var headers = form.headers; headers["Authorization"] = "Basic " + System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes("username:password")); WWW www = new WWW("http://myURL.com/assetbundle.unity3d", null, headers);
I am using Unity 5.3.4f1, iOS 9.3.2 and Android 4.1.1
If anyone knows the solution for this problem, please help me. Thanks.