i'm trying post data external url in air android app log in users. works in flash debugger on pc, not work on android device. have internet permission set app. have listeners set io_error , security_error neither of these fired. hangs there , nothing when test on device, works fine in debug player!?!?
edit: i've searched answers , closest came this: as3 air urlloader post suggest specifying content-type in request, doesn't solve issue
edit: works when upload server , add crossdomain.xml requested site.
public static function login(user:string, pass:string):void { username = user; var request:urlrequest = new urlrequest( "http://mysite.com/"+user+"/login.json" ); request.method = urlrequestmethod.post; request.contenttype = 'application/x-www-form-urlencoded'; var variables:urlvariables = new urlvariables(); variables.p = pass; request.data = variables; var requestor:urlloader = new urlloader(); requestor.addeventlistener( event.complete, loginrequestcomplete ); requestor.addeventlistener( ioerrorevent.io_error, httprequesterror ); requestor.addeventlistener( securityerrorevent.security_error, httprequesterror ); requestor.load( request ); }
well, managed nail it....
i grabbing username , password 2 textfields created in ide.
the username textfield set multiline, caused no problems in online or debugger versions, added line break textfield on android device, causing api return 400.
changed single line textfield , problem solved.
crazy :)
Comments
Post a Comment