Download File

Download File at Specified URL

Run the following GoNative JavaScript Bridge command to initiate the download of the file at the specified URL.

↔️GoNative JavaScript Bridge

To download a file:

gonative.share.downloadFile({url: 'https://yoursite.com/file.pdf', open: true|false})
// Note: 'open' is an Android-only parameter, refer to below

On iOS, the file is downloaded and passed to the "open with" system dialog.

On Android, if Downloads Folder is set on the Permissions tab by default be the file will be downloaded silently. If the open: true parameter is set once the download is complete an "open with" dialog will be displayed.

On Android, if Private to App is set on the Permissions tab the file will be downloaded internally and your app will always display an "open with" dialog.

Save Image to Photos

↔️GoNative JavaScript Bridge

To download an image to the user's iOS photo library / Android photo gallery:

gonative.share.downloadImage({url: 'https://yoursite.com/file.jpg'})

Demo

Open our demo site in your app to try it out https://demos.gonative.io/download-functions/.


Next Steps