Mark
Mark

Reputation: 18204

PhoneGap (iPhone / Xcode 4) All links open in Safari

I installed PhoneGap in Xcode but every link I place in the HTML open in Safari, is there a way to get around this? (Even window.location = ''; opens safari)

Also does anyone know how you can start with a remote address instead of a local?

Upvotes: 1

Views: 962

Answers (2)

KZeni
KZeni

Reputation: 23

Late response, but here's what I found out if anyone stumbles across this that doesn't require using the ChildBrowser plugin mentioned earlier.

Cordova.plist (found in the Supporting Files folder) has some settings for determining this behavior:

  • The URLs need to be added to "ExternalHosts" in order for them to be whitelisted (add as many as needed & you can use * as a wildcard).
  • Set "OpenAllWhitelistURLsInWebView" to YES.

There might be other settings worth configuring there as well, but those two should prevent links & window.location from opening via Mobile Safari.

Upvotes: 1

avoision
avoision

Reputation: 1235

I've never used it, but often see others referencing the ChildBrowser plugin, which looks like it may fit your needs. You can check out the readme.txt for more info.

Upvotes: 0

Related Questions