Unanswered: Request to server not working properly in Android & I phone.
Unanswered: Request to server not working properly in Android & I phone.
Hello,
I making sencha touch application in which i am sending request after every 10 sec with user id,for server side if request calls within 40 sec then i am getting response true & other online users otherwise false.It working properly in chrome(desktop)i am getting response true after every 7sec but in I Phone or Android i am getting response false after every 7 sec, this what the actual problem i am facing so please help me on this.
I am using following code.
var task = new Ext.util.DelayedTask(function(){ this.get(); task.delay(10000); }, this); task.delay(0); get: function(){ Ext.Ajax.request({ url: 'resources/api/api.php' , scope: this , params: { cmd: 'msg' , to_fb_id: fb_id } , success: function(res, request){ var rec = Ext.decode(res.responseText); Ext.Msg.alert('success',''+rec.success); if(rec.success == true){ some condition } } });
}
I also tried with set Interval, set Timeout & JSONP request .
So you send a request frequently and on Chrome it returns true which is great. When you go to the Android and iPhone it returns false with same code.
So the request needs to be evaluated on the phone versus on chrome. Is the url and params 100% the same? Are the headers correct?
If those are 100% the same then we need to look at the PHP code. What variables are different between the Chrome and phone that is causing this and what is the cause to those variables to be different?
Hello Mitchellsimoens,
Actually the request is used to check whether user login or not means on server side we are checking if this request comes within 40 sec then user is online & we get response true with other online users otherwise we are getting response false.
So in our app what happens when we login from iPhone or Android it directly gives response false.(In it is working properly on desktop).
So it sounds like the time or session isn't saved. Cookies in iOS 5.1 (maybe 5.0) are turned off by default so if you are using a session then the cookie won't be saved to the device.