I'm trying to use FakeAppUpdateManager to test in-app updates. Logic invokes startUpdateFlowForResult
internally (https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateManager#startUpdateFlowForResult(com.google.android.play.core.appupdate.AppUpdateInfo,%20int,%20android.app.Activity,%20int)) however hosting activity is never receiving anything into onActivityResult. I can expect no UI to be rendered (as per https://developer.android.com/reference/com/google/android/play/core/appupdate/testing/FakeAppUpdateManager) but why onActivityResult is never invoked?
Asked
Active
Viewed 188 times
1

ror
- 3,295
- 1
- 19
- 27
-
As per [this article](https://medium.com/wantedly-engineering/testing-android-in-app-updates-with-fakeappupdatemanager-63d0e834c36), you need to call the appropriate methods on the `FakeAppUpdateManager` to simulate the user interacting with your screen before you would expect a result. WHere do you call any of those methods? – ianhanniballake Jun 27 '21 at 21:15
-
1Saw the article, yes. I decompiled FakeAppUpdateManager and it became clear that startUpdateFlowForResult will never call activity's onActivityResult. Which rather makes FakeAppUpdateManager too fake to be useful :) – ror Jun 27 '21 at 21:43