Socket
Socket
Sign inDemoInstall

react-native-apk-installer-n

Package Overview
Dependencies
518
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-apk-installer-n

A react-native library to install APK on Android


Version published
Weekly downloads
328
decreased by-13.68%
Maintainers
1
Install size
12.5 kB
Created
Weekly downloads
 

Readme

Source

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

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

Usage

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

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)
    }
});

Keywords

FAQs

Last updated on 12 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc