iOS App Store bundle version comparison rules

戏子无情 提交于 2020-07-15 08:18:02

问题


We are going to upload new version of our app to iOS App Store.

For previos version CFBundleShortVersionString was "1.9.2" and CFBundleVersion was "1.92.0". For current version we are going to use CFBundleShortVersionString:"1.10" and CFBundleVersion:"1.100.0".

But we afraid if App Store won't detect our 1.10 version as new. Won't it be recognized as older than previos version with CFBundleVersion:"1.92.0".

In other words, is CFBundleVersion:"1.100.0" will be higher than CFBundleVersion:"1.92.0" ?

Does anybody know how Apple compare CFBundleVersion parameter of uploaded builds?

Thank you for the answers.


回答1:


Yes, 1.100.0 is > 1.92.0. Apple uses semantic versioning.

From left to right, as long as none of the numbers are less than the new number, you are good.

For your example, the check goes something along the lines of (pseudo):

var oldVersionSems = "1.92.0".split(".")
var newVersionSems = "1.100.0".split(".")
var maxIndex = MIN(oldVersionSems.length, newVersionSems.length)
var isNewer = false
for (int i = 0; i < maxIndex, i++) {
    isNewer = newVersionSems[i] > oldVersionSems[i].toInt()
    if (isNewer) break
}

A good resource for how semantic versioning works is http://semver.org

Examples:

  • 2.0.0 > 1.100.0
  • 1.20.0 < 1.100.0
  • 1.1.0 > 1.0.500
  • 1.92.0 < 1.100.0


来源:https://stackoverflow.com/questions/27405913/ios-app-store-bundle-version-comparison-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!