Last active
April 5, 2020 16:40
-
-
Save DanishAmjad12/500f2e709c69ec5d57c69b8718bcb9d0 to your computer and use it in GitHub Desktop.
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
private fun checkUpdate() { | |
// Returns an intent object that you use to check for an update. | |
val appUpdateInfoTask = appUpdateManager?.appUpdateInfo | |
// Checks that the platform will allow the specified type of update. | |
Log.d(TAG, "Checking for updates") | |
appUpdateInfoTask?.addOnSuccessListener { appUpdateInfo -> | |
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE | |
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) { | |
// Request the update. | |
Log.d(TAG, "Update available") | |
} else { | |
Log.d(TAG, "No Update available") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment