Support AndroidX and Android other version
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
You can use react-native-fs to download the apk file:
importRNFSfrom'react-native-fs'importRNApkInstallerNfrom'react-native-apk-installer-n';constfilePath=RNFS.DocumentDirectoryPath+'/com.domain.example.apk';constdownload=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)}});