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.
If the app you are testing doesn’t appear with an available update, check that you’ve properly set up your testing tracks.
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
.
Here is code:-
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")
}
}
I struggled with this same problem for a few days before once again going through the documentation thoroughly. Read this section on the official documentation of the in-app updates.
The link describes the correct testing procedure as follows:
On your test device, make sure you've already installed a version of your app that meets the following requirements:
- The app was installed using an internal app sharing URL
- Supports in-app updates
- Uses a version code that's lower than the updated version of your app
Follow the Play Console instructions on how to share your app internally. Make sure you upload a version of your app that uses a version code that's higher than the one you have already installed on the test device.
- On the test device, only click the internal app-sharing link for the updated version of your app. Do not install the app from the Google Play Store page you see after clicking the link.
- Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.
This is also super helpful because you don't have to wait for the app to be published, you can start testing immediately.