Trusted Web Activity: Is it possible to add file association

227 Views Asked by At

I have been able to successfully create a TWA from the base instructions provided. It links to the website and works as expected.

However, one of the functionalities of the web app is to upload a particular file type (which is a type of zip) and display its content. That functionality too works as expected and one is able to upload the file, say from the downloads directory to the app and it displays.

What would be desirable is: for the user to tap on the file from the directory (say downloads) and it opens in the App. I am aware of the limitations of access a local file in any web app. But before I tackle that issue I would like to know if there is a way to associate that file extension (or mime-type) with the app. And more importantly how to at least get the path of the file. In the current setup there is no custom Activity java code written. I went by the documentation and put the right settings in the manifest.xml and the site gets loaded.

Thanks.

1

There are 1 best solutions below

8
On

This is possible by implementing Web Share Target in your Progressive Web App, then enabling it in our Trusted Web Activity.

When using Bubblewrap it will to automatically configure the Trusted Web Activity on init.