0.0.13 • Published 7 years ago

react-native-install-app v0.0.13

Weekly downloads
14
License
MIT
Repository
github
Last release
7 years ago

Usage (iOS)

First you need to install react-native-install-app:

npm install react-native-install-app --save

Adding automatically with react-native link

At the command line, in your project folder, type:

react-native link react-native-install-app

Done! No need to worry about manually adding the library to your project.

Examples

Basic

// require the module
import {
  installApp,
  installAppFromStore
} from 'react-native-install-app';

// get a list of files and directories in the main bundle
// android
installApp().then((result) => {
    console.log('GOT RESULT', result);

    // stat the first file
  }).catch((err) => {
    console.log(err.message, err.code);
  });
// ios
installAppFromStore()

installApp(options: DownloadFileOptions): { jobId: number, promise: Promise<DownloadResult> }

type DownloadFileOptions = {
  fromUrl: string;          // URL to download file from
  toFile: string;           // Local filesystem path to save the file to
  headers?: Headers;        // An object of headers to be passed to the server
  progressDivider?: number;
  begin?: (res: DownloadBeginCallbackResult) => void;
  progress?: (res: DownloadProgressCallbackResult) => void;
  resumable?: () => void;    // only supported on iOS yet
  connectionTimeout?: number // only supported on Android yet
  readTimeout?: number       // supported on Android and iOS
};
type DownloadResult = {
  jobId: number;          // The download job ID, required if one wishes to cancel the download. See `stopDownload`.
  statusCode: number;     // The HTTP status code
  bytesWritten: number;   // The number of bytes written to the file
};
0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago