Hi, I am making an app that needs to retrieve small update files from our server. Our website is intoitgames.com. We are trying to use the following code in our app to retrieve a simple json file.
local loader = UrlLoader.new("<a href="http://developers.intoitgames.com/get_config.php?app=super-stickman"" rel="nofollow">http://developers.intoitgames.com/get_config.php?app=super-stickman"</a>, UrlLoader.GET)
local function onComplete(event)
print("Complete")
loader = nil
end
local function onError(event)
print("Error")
loader = nil
end
loader:addEventListener(Event.COMPLETE, onComplete)
loader:addEventListener(Event.ERROR, onError) |
We always get an Error in Gideros player even though the url "
http://developers.intoitgames.com/get_config.php?app=super-stickman" loads up just fine in the web browser.
We are making the move from Corona to Gideros, and this url does return an intact, valid json string with Corona. No reason why this doesn't work with Gideros. Sites like Google, and example.com do work. In addition, we cannot access our entire domain. Using "
http://intoitgames.com" as the url parameter for url loader does not work either. Tried restarting the computer and clearing rotten dns cache using "ipconfig /flushdns"
Last note: It worked 20 minutes ago, but now it doesn't. I DID update a couple files on the server via ftp but that should not make any difference. Perhaps I need to clear something within internal data files of Gideros?
Edit: Had 2 friends with different internet providers try. Getting the same error. Still working in Corona. Is there a way I can get more error info as the event table is rather simple. Ex: Can I get the type of error? (Ex:404, etc.)
Comments
I think you are right, I'm also getting Complete for some websites and Error for other.
It's really hard to distinguish which works which not, but for now it may seem, that shared hostings are unreachable and remote/dedicated ones are working perfectly.
However this only happens on desktop. Tested on Android device with player and everything is working there.
I'll talk to @atilim about that.
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
I am getting UrlLoader Event.ERROR when downloading files. The other files can be reached normally. I got the error on Android but no error on Windows. Several users seems to experience the error too.
I dont know exactly because we havent released crash report yet to our users so we cant get the name of the file. but i suspect a compressed image file (jpg or png). do you know what could possibly raise the error event?
If there is any response, then usually you will have COMPLETE event with specific http status code:
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
So usually it is a network problem
it should not be a network problem, because the user said that he has a working connection, and based on the first post in this thread, the poster can do it in corona version. Could gideros look into this ? users have been complaining about it and some gave us a one star. I can message you our files list if that helps
It was the issue, that UrlLoader by default had a user agent string that many hostings for some reason decided to ignore, thus providing no response, thus leading to network error.
The defaul user agent sting was changed to Gideros Agent and it all started to work on all servers it did not work before.
So this is unfortunately completely another issue.