Android in-app update returns cached app update info

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Android in-app update returns cached app update info

Artur Kasprzak

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?

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/android-platform.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/d615b3d3-44bf-4b45-aa8d-c3816e6b5f25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.