Search code examples
androidkotlinin-app-updategoogle-play-core

What purpose does appUpdateInfo.isUpdateTypeAllowed (AppUpdateType.IMMEDIATE) serve in Android In-App Update API?


I have been following In-App update API in Android for quite some time now and I am unable to find any relevance of the following line:

appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)

--

appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)

This isUpdateTypeAllowed() method has been used in the code snippet below in Android Documentation: https://developer.android.com/guide/app-bundle/in-app-updates#update_readiness. Moreover, the above two method calls return true in all the cases and I am unable to find a case for which any of the above two method calls return false.


Solution

  • I had already raised this issue in Google Issue Tracker here and I did receive response from the Google Developers as follows :

    It is up to the developer to choose which type of update is invoked. The mode is determined by the app in code. Please see https://developer.android.com/guide/app-bundle/in-app-updates#start_update

    I have already integrated in-app update api in GoIbibo Mobile Application and It is running all perfect now. The documentation had this ambiguity. So you should write your own logic whether you want Flexible or Immediate Update.