PhoneGap: Opening external URL's in Safari

后端 未结 12 894
耶瑟儿~
耶瑟儿~ 2020-11-30 03:04

I\'ve just upgraded to PhoneGap 1.6.1 and I can no longer get external URL\'s to open in Safari.

Prior to this version I had patched AppDelegate.m as follows:

<
12条回答
  •  忘掉有多难
    2020-11-30 04:04

    This is the 100% guaranteed solution if you are using Phonegap (tested in iOS 6).

    To open external URL in Safari, do following:

    1. Add your link in External Host (white list). e.g.: http://google.com/
    2. In Cordova.plist or Phonegap.plist, change OpenAllWhitelistURLsInWebView from Yes to No.
    3. In your application, add target="_blank" to your link. Example:

      Google.com
      

    Thank you.

提交回复
热议问题