Recently, Google introduced 'in-app updates' in Google I/O 2019.
So I am trying to use it.
val appUpdateManager = AppUpdateManagerFactory.create(this)
val appUpdateInfo = appUpdateManager.appUpdateInfo
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)
} else {
info("This is already latest version: ${result.updateAvailability()}")
}
}
But the result.updateAvailability()
is always UpdateAvailability.UPDATE_NOT_AVAILABLE
.
To do this, I made a signed release apk with previous version code.
But it doesn't work.
According to the demo on the Developer Keynote (16:40 ~ )
He is doing it with the emulator.
It looks like debug mode.
How can I do this same thing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…