I’m facing a wall on how to be able to download/Preview a file from a Microsoft Teams app on mobile.
We have a custom Microsoft Teams application. In our application we have files that users should be able to preview and download (such as PDF). Those files are hosted outside of the Microsoft platform.
On iOS I’m able to preview a file (not download) but on Android, I get the following error right away: “Something went wrong – This action is currently not supported on mobile”.
This is the way I’m trying to download the file:
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', fileName);
document.body.appendChild(link);
link.click();
(link.parentNode as Node).removeChild(link);
I tried multiple ways like opening in new tab, or using webkitURL, with no success.
Currently, I’m doing a custom preview of the file myself programmatically, but this is not the solution we would like to have.
If someone has any guidelines/ideas to give I’ll take it 🙂
Thank you.