I want to update my existing app using rn-fetch-blob
.
I have already installed my apk in my mobile having
versionCode 1
versionName "0.4.5"
Now I am downloading a new apk file from s3 bucket having
versionCode 1
versionName "0.4.6"
using rn-fetch-blob
as mentioned in this thread with the following code
const RNFetchBlob = require('rn-fetch-blob').default
const updateApp = () => {
console.log("App Update")
const android = RNFetchBlob.android;
let dirs = RNFetchBlob.fs.dirs;
RNFetchBlob.config({
addAndroidDownloads: {
useDownloadManager: true,
title: 'App-Testing',
description: 'An APK that will be installed',
mime: 'application/vnd.android.package-archive',
mediaScannable: true,
notification: true,
path: RNFetchBlob.fs.dirs.DownloadDir + '/app-release.apk',
},
})
.fetch(
'GET',
'https://testing-avinash-v1.s3.eu-north-1.amazonaws.com/app-release.apk',
)
.then(res => {
android.actionViewIntent(
res.path(),
'application/vnd.android.package-archive',
);
});
I am able to download the apk file but it is not updating the existing apk automatically. Is there any way I can achieve the expected result