Railsgrammer

Tag: iOS

Phone Gap Whitelist Rejection Error

by coffeencoke on Jan.19, 2012, under Development, Ruby on Rails, iOS

My mobile app continues. As I was testing my registration API through the iOS emulator I got the following error:

MyApp [97185:15603] ERROR whitelist rejection: url='http://localhost:3000'

After some quick google searching, I discovered that in order to make requests outside of the file system I had to add the host to the phone gap’s plist file. For my project this file is located at /MyApp/PhoneGap.plist. You can either edit this file with a text editor or edit it in Xcode. The end result for me to be able to hit localhost within the app looks like this:

<?xml version="1.0" encoding="UTF-8"?>
...
<key>ExternalHosts</key>
<array>
<string>localhost</string>
</array>
...

After I made that change, I restarted my app through Xcode and the app was able to hit the rails server.

Leave a Comment :, , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...