vaenow / cordova-plugin-app-update

App updater for Cordova/PhoneGap
MIT License
299 stars 146 forks source link

Cannot automatic compare AppVersion #72

Closed DerekMar closed 6 years ago

DerekMar commented 6 years ago

tim 20171208093004

tim 20171208094026

This is my app's version(3.2.4),and The server version is18(0.0.1).However, the plugins will still download the apk! The comparsion of app version do not work。

vaenow commented 6 years ago

Hi did you use the latest npm version ?

https://www.npmjs.com/package/cordova-plugin-app-update

DerekMar commented 6 years ago

@vaenow ,Sure,cordova-plugin-app-update@^1.4.12,I has tested it on different mobile.

arthursp commented 6 years ago

I saw the problem, as soon as the version is different from the server which serve the APK, it tried to download it even if it's an old version.

The problem come from this code (cordova-plugin-app-update/src/android/UpdateManager.java) :

        if (versionCodeLocal != versionCodeRemote) {

you need to do something like this :

        if (versionCodeLocal < versionCodeRemote) {
wxingheng commented 5 years ago

我使用 "cordova-plugin-app-update": "2.0.2", 最新的版本 遇到了同样的问题 永远都会重复的提示更新 即使我已经更新了 还是提醒我更新。 希望获得一些帮助,感谢