PhoneGap: Opening external URL's in Safari

后端 未结 12 865
耶瑟儿~
耶瑟儿~ 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 03:45

    to open external URL in Safari Do following steps.

    1).Add your link in External Host (white list).with complete url if you want to google url then add
    e.g.: http://google.com/

    2).In Cordova.plist or Phonegap.plist, change

    OpenAllWhitelistURLsInWebView from Yes to No

    for Android True to false.

    3). write this code for opening the URL

    window.location.href = "http://www.google.com";
    

提交回复
热议问题