- Home /
www 404 error only on iOS
Hi
I have a problem with WWW, only on iOS device. trying to download a simple plain text-file from web server.
The URL looks like this.. http://a.b.c/d_e/0.1.2/target.txt
It has alphabetic characters and some special characters only ( : / . _ ).
Has no blank space, etc. and hard-coded.
And my script(pseudo code) is..
IEnumlator Start()
{
Debug.Log( url );
using( WWW www = new WWW(url) )
{
if ( false == www.isDone )
{
Debug.Log( "yield.." );
yield return null;
}
if ( null != www.error )
{
Debug.Log( www.error );
}
else
{
Debug.Log( "SUCCEED!" );
}
}
}
Have tested..
Windows7 + unity editor 4.6.1p5
OSX Mavericks + unity editor 4.6.2
OSX Yosemite + unity editor 4.6.3
Safari, Chrome, IE...
Android device (4.3)
iOS device (7.x)
case 1,2,3,4,5 they all show me the "SUCCEED!" on log. ( Web browser display the contents of target file. )
but, "404 Not Found" only on ios ...
All log looks like below on ios
http://a.b.c/d_e/0.1.2/target.txt
yield.. <-- just one time.
404 Not Found
...
What i have missed?
Thanks.
It seems that you can not have the . (dots) in the file name!!!
Answer by phil_me_up · Dec 15, 2015 at 11:05 PM
I know that you said you're using iOS7, but something to keep in mind is ATS for iOS9 which you will need to setup within the XCode plist to make these kind of calls. https://forums.developer.apple.com/thread/3544
As for your immediate problem, there is the obvious issues such as making sure your device can actually connect to any web service. Assuming that's ok, it might be worth modifying the url (e.g. append '?randomNumber' to the end of the url) or as a temporary test placing a second file on the server and try to read that in order to avoid caching.
Your answer
Follow this Question
Related Questions
WWW.h crash in store build 5 Answers
Assetbundle memory leaks 0 Answers
OutOfMemoryException when downloading files via the www class (iOS and Android) 1 Answer
Unity 5.6.1f1 build export on IOS throws errors 0 Answers
Memory leak with WWW on iOS 1 Answer