简体   繁体   English

通过 Android 应用程序上的 Chrome 自定义选项卡下载文件时获得通知

[英]Get notified for file downloaded via Chrome custom tabs on on Android App

I'm usingchrome custom tabs on an Android App to open a webpage.我在 Android 应用程序上使用chrome 自定义选项卡打开网页。 Inside the webpage, I'm downloading a file.在网页内部,我正在下载一个文件。

Is there any way on Android, to get notified after the file has been downloaded? Android 有什么方法可以在文件下载后得到通知?

Any help would be great as I scanned through all official docs for 4 days, couldn't find anything.任何帮助都会很棒,因为我浏览了所有官方文档 4 天,找不到任何东西。

Custom Tabs doesn't provide callbacks that will notify the host application of files being downloaded.自定义选项卡不提供将通知主机应用程序下载文件的回调。

The best bet would be using something like Android's WatchService to monitor the downloads folder.最好的办法是使用 Android 的WatchService之类的东西来监控下载文件夹。 However, I haven't tested myself and there may be caveats.但是,我还没有测试过自己,可能会有一些警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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