Home > Back-end >  Android In App Update reports its worked however app is not updated
Android In App Update reports its worked however app is not updated

Time:08-17

Im attempting to test Android in app updates.

I have tried using a signed production release apk and a debug production apk with a lower app version than is available on the google play store.

I always see the in app update pop up and it completes successfully.

however the app version is not updated from the play store.

fun checkInAppUpdate() {
    val appUpdateManager = AppUpdateManagerFactory.create(this@FoundationActivity)

    val appUpdateInfoTask = appUpdateManager.appUpdateInfo

    appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
        if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
            appUpdateManager.startUpdateFlowForResult(appUpdateInfo, AppUpdateType.IMMEDIATE, this@FoundationActivity, APP_UPDATE_REQUEST_CODE)
        }
    }
    appUpdateInfoTask.addOnCompleteListener {
        Timber.e("In App update complete ${it.isSuccessful} - ${it.result}")
    }
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == APP_UPDATE_REQUEST_CODE) {
        if (resultCode == RESULT_OK) Timber.e("In App Update Worked OK")
        else Timber.e("In App Update failed with $resultCode")
    }
}

above is the code i am using

I always see this log entry "In App Update Worked OK" & In App update complete true - com.google.android.play.core.appupdate.AppUpdateInfo@f0b5242 however the app is not updated.

is it not possible to test the in app update api in this way?

is the only way to test it, to release onto the google play store?

CodePudding user response:

Test with internal app sharing

Use internal app sharing to test in-app updates by performing the following steps:

  1. Make sure your test device has a version of your app installed that supports in-app updates and was installed using an internal app sharing URL.

  2. Follow the Play Console instructions to share your app internally. Upload a version of your app that uses a version code that is higher than the one you already have installed on the test device.

  3. On the test device, click the internal app sharing link for the updated version of your app but do not install the app from the Play Store page that appears after you click the link.

  4. 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.

CodePudding user response:

goto googleplay console >App bundles > New app bundles > selected version details > downloads > Assets > Signed, universal APK Download it and upload it to your host. Only this file can replace the update through Google Play

  • Related