2

I'm using a js library inside a PhoneGap application for iPhone. I don't know what other external sites my js library contacts, so I need a way of whitelisting all connections, just for testing. How do I do that?

My app just silently fails, it doesn't continue from where the library is initiated. (when I run the app in a browser it works perfectly)

Gustav
  • 1,361
  • 1
  • 12
  • 24
  • 1
    A quick note: your app will be rejected by the app store because of this dependency... You MUST include some sort of notification to the user that the app needs a connection in order to work. I HIGHLY recommend that you include your jQuery mobile stuff in your www folder. – Drew Dahlman Apr 26 '12 at 13:11

2 Answers2

7

Try setting the value of the ExternalHosts property in Phonegap.plist to *

Nadh
  • 6,987
  • 2
  • 21
  • 21
  • Done, looks like this (http://cl.ly/0N3W0s1X27453T2V0V2x) in the editor. Have some other whitelistings as well, but they were added before and works as they should – Gustav Apr 26 '12 at 07:23
1

i think you need to add the domain names to PhoneGap.plist file or Cordova.plist.

And your App is running fine in browser. So in Browser source-code you can check-out for the external links present in your code.

Which ever file you want to access/link through internet, that server domain you need to add in plist file. suppose i have added jquery like this

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css">
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>

now i need to add code.jquery.com in PhoneGap.plist-> ExternalHosts array as string.

Sumant
  • 954
  • 1
  • 18
  • 39
  • The thing is that I don't know which external hosts that will be contacted. I've already modified Phonegap.plist to allow the library in the first place. (and the source of the library isn't readable "enough") – Gustav Apr 26 '12 at 07:12