Android in-app update returns cached app update info

44 views
Skip to first unread message

Artur Kasprzak

unread,
Jun 14, 2019, 5:17:56 PM6/14/19
to android-platform

Short: 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 in such case 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 (perhaps some 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?

Reply all
Reply to author
Forward
0 new messages