I'm trying to download directly a pdf from a web app with the command
window.open(target, '_blank', 'location=no');
In Android it works great, but in iOS it only displays me a preview of the PDF, only a "DONE" button, without any "download" or "open with" action button.
Is there any way to handle it? i've read something but didn't find anything..
Thanks
iOS doesn't work same way as Android, it can't download files.
Your options are:
Open in Safari, this way it will be displayed and will have an "Open in" option that allows you to open it in another app. To open in safari use this code
window.open(target, '_system');
Download inside your app. Here you have to options, use XHR call or use
cordova-plugin-file-transfer
For XHR see my example on this answer Download binary data into the app sandbox using XHR2 request instead of cordova-file-transferFor file-transfer see this example code: