ionic应用程序:文件url:系统打开并显示对话框 [英] ionic app: file url: system open with dialog

查看:57
本文介绍了ionic应用程序:文件url:系统打开并显示对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在离子应用程序中点击http链接(指向文件下载)时,是否可以显示本机的打开方式"对话框,建议推荐的应用程序?

Is it possible to show a native "Open With" dialog suggesting recommended apps, when the user taps on a http link (to a file download) in an ionic application?

谢谢,尼尔

推荐答案

是的,有可能.

您只需使用 Cordova InAppBrowser 来实现它.添加插件后尝试以下代码:

Simply you can use Cordova InAppBrowser to implement it. Try below code after adding plugin:

cordova.InAppBrowser.open(file_link, '_system', 'location=yes');

要更具体一点,您可以使用其他一些插件,例如 cordova-plugin-fileopener .

To be more specific you can use some other plugins such as cordova-plugin-fileopener.

这篇关于ionic应用程序:文件url:系统打开并显示对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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