Download File

Prompt Share Dialog

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

↔️GoNative JavaScript Bridge

To invoke the native share dialog for a file:

gonative.share.downloadFile({url: 'https://yoursite.com/file.pdf'})

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

On Android, the file is downloaded to the device's Downloads directory if the Downloads Directory setting is enabled within the App Permissions section of your app builder. Otherwise, it is downloaded internally and the app then shows an "open with" dialog.

Save Image to Photos

↔️GoNative JavaScript Bridge

To download an image to the user's photo library (iOS only):

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