I am trying to integrate the new In-App Update API but I cannot able to test it's implementation. Seems like my code is fine therefore I read the Troubleshoots and am not able to understand 2 points in this document
Make sure that the app that you are testing is signed with the same signing key as the one available from Google Play.
- 在连接的设备上安装APK时,如何在调试模式下使用相同的签名密钥签名?
If the app you are testing doesn’t appear with an available update, check that you’ve properly set up your testing tracks.
- Is it compulsory to release App in internal testing tracks to test implementation?
Anyway I just want to test on my device and I decremented the version code from the play store version but its showing always UPDATE_NOT_AVAILABLE
.
以下是代码:-
val appUpdateInfo: Task<AppUpdateInfo> = appUpdateManager.appUpdateInfo
appUpdateInfo.addOnSuccessListener {
if (it.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && it.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
appUpdateManager.startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, this, 2);
}else{
toast("Not Available")
}
}