Whitelist rejection error in Xcode for Sencha touch 2 and Phonegap

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

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 entry was posted in Phonegap, Sencha Touch 2, Xcode on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

7 thoughts on “Whitelist rejection error in Xcode for Sencha touch 2 and Phonegap”

  1. Anonymous

    I did this change and recompiled the build. but things are still same and its giving me error as whitelist rejection.

    Is their anything else I have to look at?

    Reply ↓
  2. Trade My God

    I 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 http://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?

    Reply ↓

Leave a Reply

Your email address will not be published. Required fields are marked *