-
21 Nov 2012 12:35 PM #1
[2.1.0] JSONP doesn't work in iOS package
[2.1.0] JSONP doesn't work in iOS package
I have used Ext.data.JsonP in my sencha 2.1.0 app and it works until I use it in browser. I'm using Sencha Architect and after iOS packaging when I try my app on device (or simulator) no data are loaded. I have changed using ajax and my app now works in iOS package also.
-
21 Nov 2012 2:59 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,128
- Vote Rating
- 453
Are you sure what you are returning is valid JSONP? I have a store that uses jsonp proxy that works.
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.
-
24 Nov 2012 12:29 AM #3
This function works in Chrome and doesn't works in iOS:
PHP Code:getData: function(url,methodName,args,fnSuccessCallback,scope,timeout,waitMsgCmp,fnErrCallback) {
if(timeout===undefined||timeout===null){
timeout=3000;
}
if(waitMsgCmp===undefined||waitMsgCmp===null){
waitMsgCmp=Ext.Viewport.xtype;
}
Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked({ xtype:'loadmask',message: 'Attendere' });
timeout=setTimeout(function(){Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked(false);fnErrCallback();}, timeout);
Ext.data.JsonP.request({
scope:scope,
url: url,
params:{[
methodName: methodName,
args:args,
time: new Date().getTime()
},
callbackKey: 'callback',
callback: function (success,jsonData) {
Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked(false);
clearTimeout(timeout);
fnSuccessCallback(jsonData,this);
}
});
}
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote