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

LatestVersionCode is always null #99

Closed SembaMax closed 7 years ago

SembaMax commented 7 years ago
AppUpdaterUtils appUpdaterUtils = new AppUpdaterUtils(this)
    .setUpdateFrom(UpdateFrom.GOOGLE_PLAY)
    .withListener(new AppUpdaterUtils.UpdateListener() {
        @Override
        public void onSuccess(Update update, Boolean isUpdateAvailable) {
        Log.d("Latest Version Code", update.**getLatestVersionCode**()); 
        }

        @Override
        public void onFailed(AppUpdaterError error) {
            Log.d("AppUpdater Error", "Something went wrong");
        }
     });
appUpdaterUtils.start();

I used that code mentioned above and it worked fine. but the latest version code always has a null value.

javiersantos commented 7 years ago

Update#getLatestVersionCode() is only available when using UpdateFrom.JSON or UpdateFrom.XML. You should use Update#getLatestVersion() instead.