Can some one share a good way to handle application update from the app store and possibly how to redirect the user to the app store?
I am thinking to do a simple API call to the my server to check for current app version but I don’t know how to make a link to my app in the app store ( iOS - android ). do you guys have a good suggestion to handle this?
After looking into this a little more, I think a good way to go about this is creating a directive that will check the current app version via an API call. I did something like this for now
I get the newest App Version from the server and pass it to this function that compares and if outdated, it opens Google Play Store or Apple App Store directly to my app’s page. You need to replace the links with your app page.
Also, the app version comparison is done using NPM plugin compare-versions.
function shouldUpdate(newestAppVersion) {
// if THIS_VERSION >= newestAppVersion, does nothing
if (newestAppVersion === undefined
|| $window.compareVersions(newestAppVersion, THIS_VERSION) <= 0) {
return false;
}
if (ionic.Platform.isAndroid()) {
$window.open("https://play.google.com/store/apps/details?id=com.example.app&hl=en","_system");
} else {
// iOS
$window.open("itms-apps://itunes.apple.com/br/app/example-app/id1234567890?mt=8","_system");
}
}