0

I have refer this link to implement but dialog not showing.

    override fun onResume() {
    super.onResume()

    val appUpdateManager = AppUpdateManagerFactory.create(this)
    appUpdateManager.appUpdateInfo
            .addOnSuccessListener {
                if (it.updateAvailability() ==              UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS) {
                    // resume the update flow
                    appUpdateManager.startUpdateFlowForResult(
                            it,
                            IMMEDIATE,
                            this,
                            123)
                }
            }
}

decrease my current version and check but "addOnSuccessListener" listener not calling.

Raj Gohel
  • 524
  • 6
  • 11
  • In order to make it work from the first time in some cases you will have to clear Play Store's cache and be sure that the gmail account you are using while testing owns the app too! – hardartcore Jan 07 '20 at 11:17
  • 1
    Does this answer your question? [How to force update in Android application if new version is available?](https://stackoverflow.com/questions/41296491/how-to-force-update-in-android-application-if-new-version-is-available) – InsaneCat Jan 07 '20 at 12:25

1 Answers1

1

I have the same confusion when I implemented this. But It takes time. It will not work immediately. You will get it in 24 hours as per my experience.

For more information, you can have a look at this S.O. answer. I followed the same and It's working now.

It worked for some device on the same day and for other devices, in-app dialog came the next day. We've tested with various devices without any issue. you just need to wait for a while.

Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
  • But i have not upload new release on play store, I have decrease my version for checking functionality – Raj Gohel Jan 07 '20 at 11:37
  • Without upload a new release on the play store it is not going to work. I tried the same before. you have to update it on play store. – Rumit Patel Jan 07 '20 at 12:48