-
2 Apr 2012 4:02 AM #1
Unanswered: Ext.util.jsonp request does not work on device android 2.3 / iphone 5.1
Unanswered: Ext.util.jsonp request does not work on device android 2.3 / iphone 5.1
Hello. I have a simple application that requets data to a server using ext.util.jsonp.
My server is made with Embarcadero Delphi 2010, and runs on local network over port 81.
If I use google chrome to run the application, it works good and ext.util.jsonp request gets information from server. I use for the url: "http://192.168.0.10:81"
But if I try it with iphone or android device on the same network, it does not work. For iphone I have put the files on a public server, but with android I have made an apk with eclipse and phonegap, and install it on the device.
I use jsonp to avoid cross-domain problem, as said in documentation.
No error is reported, but ext.util.jsonp does not connect neither run the callback function.
Any suggestion?
Thanks.
-
2 Apr 2012 6:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
You should use a remote debugger to see if there are any errors. Also would look at server logs to see if the server was hit and with what params.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Apr 2012 10:14 AM #3
Yes, the first thing I did was activate debug on safari (on iphone), but no errors reported in my phone. It doesn't call "callback" function. I put index.html the code here:
If I test It with Google Chrome, all message are shown and works good.Code:<!DOCTYPE HTML> <html> <head> <title>Test jsonp</title> <link rel="stylesheet" href="sencha-touch.css" type="text/css" > <script type="text/javascript" charset="utf-8" src="sencha-touch.js"></script> <script > Ext.regApplication({ name: 'testJsonp', launch: function() { var temporizador = setInterval(function(){ alert('requesting...'); Ext.util.JSONP.request({ url: 'http://192.168.0.10:81', callbackKey: 'callback', callback: function(result) { alert('receive'); } }); },3000); } }); </script> </head> <body > </body> </html>
With my iphone 4G (ios 5.1), and with my arnova 7b G2 (android 2.3), only alert message "requesting..." is shown. No errors in safari debug on iphone.
As you can see, a local ip is used. The PC in this computer runs a http server that works good because with google chrome (on the same pc but with network ip) works good.
Thanks for your help.
-
7 Aug 2012 7:06 AM #4
Jsonp does not work on Android emulator
Jsonp does not work on Android emulator
Is there a solution for this problem? Even I have run into the same issue. Infact twitter app also does not work when you bundle it as an apk and deploy on Android emulator.


Reply With Quote