Hello,
If you have developed iPhone application using sencha touch 2 and phonegap and if your application is using Ajax request or JsonP request you might have above error. That's not the issue of cross domain because when you convert your sencha touch application to native app using phonegap, it loads index.html and other js files in browsers using file uris. Something like below
If you have developed iPhone application using sencha touch 2 and phonegap and if your application is using Ajax request or JsonP request you might have above error. That's not the issue of cross domain because when you convert your sencha touch application to native app using phonegap, it loads index.html and other js files in browsers using file uris. Something like below
file://..
So there is no issue of cross domain. But still if you get above error. That's because of iPhone security restriction. You must add your domain to whitelist. For that open the file phonegap.plist and you should see following.
See the external host. Here you have to add your domain something like below
TEST.MYDOAMIN.COM
Make sure that you don't add http or other protocols. Just a domain name and it should work.
This would be really useful if i had a phonegap.plist file.
ReplyDeleteThey renamed it to cordova.plist.
DeleteI did this change and recompiled the build. but things are still same and its giving me error as whitelist rejection.
ReplyDeleteIs their anything else I have to look at?
Try to put a * in order to accept every external server
ReplyDeleteThat is potentially insecure.
DeleteI have added my URL under the external host - it works, but what happens is XCODE calls in the safari browser. I have embeded video into my app from youtube, I added *.youtube.com as an external host (I have also tried www.youtube.com) but when I view in simulation, the viewer just jumps to the embed video using safari browser. Has this happened to anyone else?
ReplyDeleteYou can set OpenAllWhitelistURLsInWebView to YES in your cordova.plist file and this will resolve an issue.
Delete