Last active
May 11, 2019 07:07
-
-
Save BurningDroid/65e2d3e124a738d12baea86d7f13bf85 to your computer and use it in GitHub Desktop.
Android: in-app updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val appUpdateManager = AppUpdateManagerFactory.create(this) | |
appUpdateManager.appUpdateInfo.addOnCompleteListener { | |
val result = it.result | |
if (result.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE | |
&& result.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) { | |
info("should show update") | |
appUpdateManager.startUpdateFlowForResult( | |
result, | |
AppUpdateType.FLEXIBLE, | |
this, | |
1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment