javiersantos / AppUpdater

A library that checks for your apps' updates on Google Play, GitHub, Amazon, F-Droid or your own server. API 9+ required.
Apache License 2.0
1.98k stars 412 forks source link

UpdateListener methods not called #80

Closed balazsgerlei closed 7 years ago

balazsgerlei commented 7 years ago

Hi! We are using this library for quite a time and all was good until recently. We have two separate flavours of our app, one which is released to the Play Store and one which used for development purposes. Both apps check for updates using this lib, but obviously the development flavour never has updates (as it is not published to the Play Store). We do not use the built-in dialogs of this lib, but use an UpdateListener and do our own logic, like this:

appUpdaterUtils
    .setUpdateFrom(UpdateFrom.GOOGLE_PLAY)
    .withListener(new AppUpdaterUtils.UpdateListener() {
        @Override
        public void onSuccess(Update update, Boolean isUpdateAvailable) {
            // OUR OWN LOGIC
        }

        @Override
        public void onFailed(AppUpdaterError error) {
            // OUR OWN LOGIC
        }
    });
appUpdaterUtils.start();

Until version 2.5, the UpdateListener's onSuccess method was always called on our development flavour with the isUpdateAvailable value as false. Since 2.5.1, sometimes none of the methods of the UpdateListener are called, and sometimes the same happens as before. It is not deterministic and I could not find anything that triggers the wrong behavior yet.

Could you look into this issue? We will use version 2.5 until it is resolved.

balazsgerlei commented 7 years ago

Maybe this is related: #79

javiersantos commented 7 years ago

https://github.com/javiersantos/AppUpdater/releases/tag/2.5.3

balazsgerlei commented 7 years ago

Well, with the removal of the AppUpdaterUtils, it is not fixed: https://github.com/javiersantos/AppUpdater/commit/d172d9a398dd070042e02b899375e8c86af68ee6

In fact, it is no longer possible.

javiersantos commented 7 years ago

Forget the previous release.

https://github.com/javiersantos/AppUpdater/releases/tag/2.5.4

Is the issue fixed with the 2.5.4 update?

balazsgerlei commented 7 years ago

Yes, it does seem to have fixed it. Thanks!