[英]Download a file and show it in downloads app or in notification in a cordova app
How do i make a file appear in the downloads app or in notification. 如何使文件出现在下载应用程序或通知中。 Whenever a user clicks on the download in the app i want the file to get downloaded and show up in the default downloads app.
每当用户单击应用程序中的下载时,我都希望文件被下载并显示在默认下载应用程序中。
I could use the file transfer option of Cordova but it doesn't show up in the downloads app. 我可以使用Cordova的文件传输选项,但不会在下载应用程序中显示。
You need to use cordova InAppBrowser(cordova-plugin-inappbrowser). 您需要使用cordova InAppBrowser(cordova-plugin-inappbrowser)。
window.open('http://www.myurl.com/file.pdf', '_system');
This will open the link in a system app. 这将在系统应用程序中打开链接。 Which in most cases solves the problem.
在大多数情况下,这可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.