xuexiangjys / react-native-xupdate

A React-Native plugin for XUpdate(Android Version Update Library)
Apache License 2.0
53 stars 20 forks source link

What is the logic of version judgment? #13

Closed Shuo-Mr closed 3 years ago

Shuo-Mr commented 3 years ago

I don't know if it's a bug。Does the internal check version use appVersion or appVersion code?After I return the data according to the format, the return value is always {"code": 2004, "detailmsg":“ Code:2004 , MSG: it's the latest version! "Message" is the latest version! "} image

environment: "react-native": "0.63.2", "react-native-xupdate-new": "^1.0.2",

code:

  checkUpdateSupportBackground() {
    let args = new UpdateArgs('http://xxx.xxx.xxx/updateApp.json');
    args.supportBackgroundUpdate = true;
    XUpdate.update(args);
  }

The JSON file is as follows:

{
  "code": 0,
  "msg": "",
  "updateStatus": 1,
  "versionCode": 10105,
  "versionName": "1.1.5",
  "modifyContent": "1、增加版本验证",
  "downloadUrl": "http://xxx.xxx/xxxx.apk",
  "hasUpdate": true,
  "apkSize": 2048,
  "apkMd5": ""
}

The APK version on the machine is:

versionCode: 10001,
versionName: "1.0.1"

thank you!

Shuo-Mr commented 3 years ago

I can use a custom parser. Just after I read the source code, it seems that the hasupdate parameter judgment logic failed. If I use the original parser.

Specific I did not debug, after all, the source code read-only, no testing