# @dominicvonk/react-native-apk-installer

> A react-native library to install APK on Android

Latest version **2.2.2** (published 2022-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dominicvonk/react-native-apk-installer
pnpm add @dominicvonk/react-native-apk-installer
yarn add @dominicvonk/react-native-apk-installer
bun add @dominicvonk/react-native-apk-installer
```

## 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.2.2 |
| Published | 2022-01-27 |
| First published | 2022-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dominicvonk |
| Keywords | react-native, react-native-app-install |

## Links

- npm: https://www.npmjs.com/package/@dominicvonk/react-native-apk-installer
- Repository: https://github.com/dominicvonk/react-native-apk-installer
- Homepage: https://github.com/dominicvonk/react-native-apk-installer#readme
- Issues: https://github.com/dominicvonk/react-native-apk-installer/issues
- npm.io page: https://npm.io/package/@dominicvonk/react-native-apk-installer

## Recent versions

- 2.2.2 (latest) — 2022-01-27

## README

# react-native-apk-installer

Support AndroidX and Android other version

## Getting started

AndroidX `$ yarn add @dominicvonk/react-native-apk-installer`

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

`$ react-native link @dominicvonk/react-native-apk-installer`

## Usage

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

```javascript
import RNFS from "react-native-fs";
import RNApkInstaller from "@dominicvonk/react-native-apk-installer";

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) {
    RNApkInstaller.install(filePath);
  }
});

// Do you have permission to install from unknown sources?
RNApkInstaller.haveUnknownAppSourcesPermission();

// Turn on Unknown Sources permission settings
RNApkInstaller.showUnknownAppSourcesPermission();
```

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