Cordova Plugin for Android In-App Update support. https://developer.android.com/guide/playcore/in-app-updates
- compatible with ionic 4/5
- check available update in Play Store
- download and install update
- android
$ ionic cordova plugin add https://github.com/gecsbernat/Ionic-Cordova-Plugin-InappUpdate.git
// declare plugin after imports
declare const InappUpdate: any;
// check for update
InappUpdate.check(
(success: any) => {
if (success !== "false") {
// success = versionCode to update
console.log("available versionCode:", success);
InappUpdate.update(
(success: any) => {
console.log(success);
},
(error: any) => {
console.log(error);
}
);
} else {
console.log("no update available");
}
},
(error: any) => {
console.log(error);
}
);