如何获取链接以在 iOS Meteor 应用程序的本机浏览器中打开? [英] How to get links to open in the native browser in iOS Meteor apps?

查看:53
本文介绍了如何获取链接以在 iOS Meteor 应用程序的本机浏览器中打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Meteor for iOS 构建的应用程序中,如何防止在应用程序内浏览器中打开外部链接?我希望它们改为在 Safari 中打开.

How do I prevent external links from opening in the in-app browser in apps built with Meteor for iOS? I want them to open in Safari instead.

推荐答案

您需要下载并安装 apache cordova 插件才能将此功能添加到您的meteor ios 应用程序中.

You'll need to download and install an apache cordova plugin to add this functionality into your meteor ios app.

只需在终端中运行此命令

Simply run this command into your terminal

meteor add cordova:cordova-plugin-inappbrowser@https://github.com/apache/cordova-plugin-inappbrowser/tarball/ba7cbe58d5812b51c3ece1

(这里是 tarball/ba7cbe58d5812b51c3ece1 的 ref)(使用最新的提交到主分支)

(here is a ref to the tarball/ba7cbe58d5812b51c3ece1) (use the latest commit to master branch)

然后只需将其添加到您的流星模板中,即可通过外部链接启动系统默认浏览器应用程序:

Then simply add this into your meteor template to launch the system default browser app with the external link:

<a href="" onclick="window.open('http://www.example-url.com', '_system');">
Hope this helps!
</a>

运行:流星运行 ios-device

Run: meteor run ios-device

(选择您信赖的模拟器并对其进行测试)

(select your trusty simulator and test her out)

这篇关于如何获取链接以在 iOS Meteor 应用程序的本机浏览器中打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆