简体   繁体   中英

Testing in app update with Internal app sharing

I just started research on the inApp update. all code done as per google document

appUpdateManager.getAppUpdateInfo().addOnSuccessListener(new OnSuccessListener<AppUpdateInfo>() {
        @Override
        public void onSuccess(AppUpdateInfo result) {

            tvPackageName.setText("packagename : "+result.packageName());
            tvCurrentVersionCode.setText("Current version: " + BuildConfig.VERSION_CODE);
            tvAvailableVersion.setText("available version : "+result.availableVersionCode());
            tvUpdateAvailibility.setText("update availibility :  "+ result.updateAvailability());
            tvInstallStatus.setText("install status:  "+ result.installStatus());


            if (result.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE &&
                    result.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {

                try {
                    appUpdateManager.startUpdateFlowForResult(
                            result, AppUpdateType.FLEXIBLE, activity, RC_APP_UPDATE);
                } catch (IntentSender.SendIntentException e) {
                    e.printStackTrace();
                }

            } else if (result.installStatus() == InstallStatus.DOWNLOADED) {
                popupSnackbarForCompleteUpdate();
            } else {
                Log.e("issue", "checkForAppUpdateAvailability: something else");
            }
        }
    });

but Now very important part Testing in-app update with internal app sharing

for that I follow (Android Dev Summit '19) video of test_inappupdate with internal app sharing*

I did the same as he said but update popup dialog not getting in my app

在此处输入图像描述

step 1: I set test mode from playstore app
step 2: I upload version code - 10 app at inappsharing
step 3: share link and download app from link
step 4: as per android video screen shot said i upload new build with same version.
step 5: click on new generated link.
step 6: open app again (but popup dialog not open,state= UPDATE_NOT_AVAILABLE)
在此处输入图像描述

I'll admit it's not ideal, but you could start off by testing your in-app update through one of the more conventional internal test track. If it works there then you know your app-code is fine and that it's just a problem with internal app sharing.

  • In-app updates are available only to user accounts that own the app. So, make sure the account you're using has downloaded your app from Google Play at least once before using the account to test in-app updates.

  • Make sure that the app that you are testing in-app updates with has the same application ID and is signed with the same signing key as the one available from Google Play.

  • Because Google Play can only update an app to a higher version code, make sure the app you are testing as a lower version code than the update version code.

  • Make sure the account is eligible and the Google Play cache is up to date. To do so, while logged into the Google Play Store account on the test device, proceed as follows:

    1. Make sure you completely close the Google Play Store App.
    2. Open the Google Play Store app and go to the My Apps & Games tab.
    3. If the app you are testing doesn't appear with an available update, check that you've properly set up your testing tracks.

Note: The in-app update feature is available for API level 21 or above and is only available to those apps which are on the play store.

Are you using different accounts in google studio for app development? You need to be connected to the acc that you got the ID and Key with for the app.

That video provides outdated information. Re-uploading the same bundle/apk does not help to test in-app update. I had success with pushing two consecutive versions to Internal App Sharing.

Check this answer for details: https://stackoverflow.com/a/59266778/15139

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.

https://developer.android.com/guide/playcore/in-app-updates#internal-app-sharing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM