I have an android app which is published on play store. Am trying to implement in App update and test it using android internal track sharing.
For sharing on internal track i tried following and everything gave me same results. 1. Created Apk. Signed with release key of the application 2. Created aap bundle. Signed with release key of the application 3. Created Apk . kept it in debug mode without signing 4. Created aap bundle. kept it in debug mode without signing.
In all above scenarios after uploading the application on internal test track and downloading from the url following consistent behavior is noticed.
- appUpdateInfoTask.addOnSuccessListener is called on application launch
- appUpdateInfo.availableVersionCode() returns the version code of internal test track app instead of update available on production.
- appUpdateInfo.updateAvailability() returns update unavailable.
Alongwith this in logcat we get following point of interest logs.
(app package name) is installed but certificate mismatch.
my code for app update is as followed.
private void checkforappupdate() {
Log.v("oneteamlive",".........checking for application update....");
// Creates instance of the manager.
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(this);
// Returns an intent object that you use to check for an update.
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
// Checks that the platform will allow the specified type of update.s
appUpdateInfoTask.addOnSuccessListener(
appUpdateInfo -> {
Log.v("oneteamlive","in app update info listenere");
Log.v("oneteamlive","Available version code is:"+appUpdateInfo.availableVersionCode());
Log.v("oneteamlive","Available version code is:"+appUpdateInfo.updateAvailability());
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE)
{
// Request the update.
Log.v("oneteamlive","A new update is available");
Toast.makeText(this,"A new update is available",Toast.LENGTH_LONG).show();
}
else
{
Log.v("oneteamlive","no app update is available");
}
});
}
I have double check that my playstore is completely closed and update is available with higher version code on playstore.
Anybody else also faced similar issues ??