4

I am trying to test in app update from Internal Testing track in Play Store. The code that I am using -

    public void checkForUpdate() {
    appUpdateManager = AppUpdateManagerFactory.create(this);

    // Returns an intent object that you use to check for an update.
    appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

    // Checks that the platform will allow the specified type of update.
    appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
        if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
            if (!isActivityFinished) {
                showUpdateAppDialog(() -> startUpdate(appUpdateInfo));
            }
        }
    }).addOnFailureListener(e -> {
        Log.e(BaseActivity.class.getSimpleName(), e.getMessage());
    });
}

private void startUpdate(AppUpdateInfo appUpdateInfo) {
    try {
        AppsflyerHelper.sendEvent(AppsflyerEventType.START_UPDATE_TRY, new HashMap<>(), MainApp.getInstance().getDataManager(), FirebaseFirestore.getInstance());
        appUpdateManager.startUpdateFlowForResult(
                // Pass the intent that is returned by 'getAppUpdateInfo()'.
                appUpdateInfo,
                // Or 'AppUpdateType.FLEXIBLE' for flexible updates.
                AppUpdateType.IMMEDIATE,
                // The current activity making the update request.
                this,
                // Include a request code to later monitor this update request.
                UPDATE_REQUEST_CODE);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

I have uploaded the app on Play Store in Internal Testing and when I upload another upgraded version on Play Store in Internal Testing, then I don't get the force update popup. It gives the error : Install Error(-10): The app is not owned by any user on this device. An app is "owned" if it has been acquired from Play.

I had logged this error on Crashlytics and from there I could get it back.

Any idea why this is happening

  • Check this: [https://github.com/kumparan/react-native-android-inapp-updates/issues/12#issuecomment-908265076](https://github.com/kumparan/react-native-android-inapp-updates/issues/12#issuecomment-908265076) – Drioueche Mohammed Apr 25 '22 at 15:11

1 Answers1

1

The answer is a little late but if it helps someone here it is, to test the in-app update functionality you must distribute the application through the internal sharing of play store apps, the following link is the official documentation with the steps to follow:

https://developer.android.com/guide/playcore/in-app-updates/test?hl=es-419