简体   繁体   中英

Open Safari from in app Links - Cordova PhoneGap

I have a mobile app that works great minus one thing. I have a couple links that really need to go out of the webapp and open Safari to handle the content with the "Back to..." app at the top left. But no matter what I try including target="blank" ("_system", etc). All open within the app and I lose all control of the app and any navigation. I need these few links to jump out of the app and open Safari.

Can this be done outside the app on the web side or only internal? How do I pop the safari open???

Use the InAppBrowser Plugin . Verify its installed correctly and then call it within your deviceready handler like so:

cordova.InAppBrowser.open('http://yoursite.com', '_system', 'location=yes');

The OpenUrlExt plugin should make the native system call for you:

Open a specific URL in the external browser of the hosting OS.

cordova plugin add https://github.com/PaoloMessina/OpenUrlExt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM