[File Transfer Plugin] Does File Transfer Plugin works for PWA generated app?
Question
Forge component by OutSystems R&D

Hello,

I wanted to know if PWA generated app can use the File Transfer Plugin. I tried following the file transfer plugin sample app but nothing is downloaded, I also tried set up in the OnReady for the FilePath but I get error message "Cordova not defined".

Hi Wenchester,

How are you accessing your PWA? Most Cordova plugins will only work on mobile devices. 

Hi Jeroen,

I install it in my android phone through browser "Add to Home"

Champion

Hi Wenchester 

Because File Transfer Plugin supports browser, So I think it will work on PWA.

Can you upload oml file? So we can take a look for more details.

Best Regards


mvp_badge
MVP

Hi Wenchester, 

You can inspect the codeof the FileTransfer Plugin by opening the module  in service studio. What you will see is that it uses a Cordova github project and that on every download/upload action it checks for the existence of the cordova plugin and cordova. 

As a PWA does not run in a cordova shell, but directly in the  browser, I believe the plugin cannot be used when installed as a PWA. You can test this out by installing the accompanying demo application as a PWA on your mobile device. You will notice an error message is shown "Cordova is not defined".

Regards,

Daniel

So if I want to distribute my apps as a PWA and want to have a download feature in my mobile apps, how to do so?

Staff

Hi Wenchester, 

You can do it by using FileSave js. Here you have a sample on how to download a file in a PWA. Let me know if it works for you.

Thanks!

PWAUtilsSample.oap

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.