0

When Users downloads the app via Flexible app update

appUpdateManager?.startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, activity, REQUEST_CODE_FLEXI_UPDATE)

but forgets or accidentally skips to click the restart app button which does following:

            appUpdateManager?.completeUpdate()

Then app update is not available. Even I tried with clear app data, it doesn't work. Looks like once app is downloaded via inappupdate and skips installation, you're stuck, it doesn't ask again.

appUpdateManager?.appUpdateInfo?.addOnSuccessListener { appUpdateInfo ->
            if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
                updateAvailable.value = true
            }
        }

Is there a solution to this? Other things are working and it's live on playstore just looking for solution of such use-case.

Also how to get progress value of app being downloaded, couldn't find it in documentation. In my case, onActivityResult keeps calling but which key gives progress value?

Also facing another issue with different use case: java.lang.reflect.InvocationTargetException while inappupdate android if retries

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
AskQ
  • 4,215
  • 7
  • 34
  • 61

1 Answers1

0

You should check for appUpdateInfo.installStatus() == InstallStatus.DOWNLOADED on app restart and call completeUpdate() at some point as per the documentation.

wojtek.kalicinski
  • 1,090
  • 7
  • 13