# react-native-apk-installer-n

> A react-native library to install APK on Android

Latest version **2.1.2** (published 2020-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-apk-installer-n
pnpm add react-native-apk-installer-n
yarn add react-native-apk-installer-n
bun add react-native-apk-installer-n
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2020-10-12 |
| First published | 2018-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Zixuan Liu |
| Maintainers | nodece |
| Keywords | react-native, react-native-app-install, react-native-app-installer-n |

## Links

- npm: https://www.npmjs.com/package/react-native-apk-installer-n
- Repository: https://github.com/nodece/react-native-apk-installer-n
- npm.io page: https://npm.io/package/react-native-apk-installer-n

## Recent versions

- 2.1.2 (latest) — 2020-10-12
- 2.1.1 — 2020-04-07
- 2.1.0 — 2020-04-06
- 2.0.1 — 2020-03-12
- 2.0.0 — 2020-02-17
- 1.0.6 — 2019-04-06
- 1.0.5 — 2018-08-03
- 1.0.4 — 2018-08-03
- 1.0.3 — 2018-08-03
- 1.0.2 — 2018-08-03
- 1.0.1 — 2018-08-03
- 1.0.0 — 2018-08-03

## README

# react-native-apk-installer-n

Support AndroidX and Android other version

## Getting started

AndroidX  
`$ yarn add react-native-apk-installer-n`

Other version  
`$ yarn add react-native-apk-installer-n@1`


### Mostly automatic install with react-native link (RN < 0.60)

`$ react-native link react-native-apk-installer-n`

## Usage

You can use react-native-fs to download the apk file:

```javascript
import RNFS from 'react-native-fs'
import RNApkInstallerN from 'react-native-apk-installer-n';

const filePath = RNFS.DocumentDirectoryPath + '/com.domain.example.apk';
const download = RNFS.downloadFile({
    fromUrl: 'apk file download url',
    toFile: filePath,
    progress: res => {
        console.log((res.bytesWritten / res.contentLength).toFixed(2));
    },
    progressDivider: 1
});

download.promise.then(result => {
    if(result.statusCode == 200){
        RNApkInstallerN.install(filePath)
    }
});
```

---
_Source: https://npm.io/package/react-native-apk-installer-n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
