Skip to content

reggie3/versioned-file-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Versioned File Downloader

A package that uses the Expo FileSystem API to download files to a mobile device.

Why use this?

You need to download files to a mobile device, and you need to be able to download files again when their versions change.

Why not use this?

You're not downloading files to a mobile device

npm npm npm npm

Usage

npm install --save versioned-file-downloader

or

yarn add versioned-file-downloader

And import like this

import versionedFileDownloader from 'versioned-file-downloader';

Call the asynchronous versionedFileDownloader and pass it the parameters shown below to save the files to a directory of the form [device document root return by Expo FileSystem API]/[package name]/[version]/

let downloadStatus = await versionedFileDownloader(
    this.webViewDownloadStatusCallBack,
    {
        name: config.PACKAGE_NAME,          // the name of the package, this will be the root directory for the files
        version: config.PACKAGE_VERSION,    // the version number, this will be a subfolder of the root that the file will be saved to
        files: FILES_TO_DOWNLOAD,           // the files to be saved 
    }
);

About

Download files required by react-native WebView to local device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published