Working with google's new feature in-app update I noticed it seems to return old (previous) update info rather than correct newest one.
Android introduced new force update feature some time ago: https://developer.android.com/guide/app-bundle/in-app-updates called in-app updates
Working with it I noticed that when obtaining app update info according to google's tutorial the returned app version code sometimes is not up-to-date with version code of app available in store (has a previous updates info). It strongly looks like the app update info we request in code is take from cache rather than real google play store services.
val appUpdateManager = AppUpdateManagerFactory.create(context)
val appUpdateInfoTask = appUpdateManager.appUpdateInfo
appUpdateInfoTask.addOnCompleteListener { task ->
when {
task.isSuccessful -> {
val appUpdateInfo = task.result
//the successful app update info may have old (previous) info
[...]
}
[...]
}
}
When we decide to activate the force update flow app will be updated to wrong version, even when there is available higher version of app in store.
Exploring the subject deeper I found out that, when perform update on any other app via Google Play Store, our action will trigger cache refresh and next time the in-app update flow returns correct values and updates to correct app update.
Does anyone have any idea how to obtain correct (newest) available app version code via in-app update or force refresh play store cache programatically?
UPDATE:
I had a change to talk with google dev about this case on one of the conferences. From what he said there is no way to trigger programmatically Google Play's listing update (information about available updates) - user have to manually enter it and then the listing is updated. Google Play's cache last for 24h and I was told Google Play should refresh it's listing then.