开发者

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

I inst开发者_开发技巧alled 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜