ArtSabintsev / Siren

Notify users when a new version of your app is available and prompt them to upgrade.

Home Page:http://sabintsev.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should the version check be <= instead of < ?

g012 opened this issue · comments

commented
  • Using latest version of Siren
  • app is com.teepic
  • last published March 15
  • published in FR store

Our app triggers the update popup since last update (2.11.0 -> 3.1.8). I have an issue with this function :

static func isAppStoreVersionNewer(installedVersion: String?, appStoreVersion: String?) -> Bool {
    guard let installedVersion = installedVersion,
        let appStoreVersion = appStoreVersion,
        (installedVersion.compare(appStoreVersion, options: .numeric) == .orderedAscending) else {
            return false
    }
    return true
}

Shouldn't it be .orderedAscending OR .orderedSame ?
Right now the popup says there is a new version, 3.1.8, but running version IS 3.1.8. Am I missing some settings ?

Thank you.

Thanks for the message. I'll take a look in the morning.

commented

I've figured out the problem, Siren is correct. It turns out we were misusing CFBundleShortVersionString and CFBundleVersion, most likely since years. We used to set the first to "3.1" (major.minor) and second to "8" (patch), since Apple requires CFBundleVersion to increase each time we submit, when CFBundleShortVersionString doesn't. But Siren only checks CFBundleShortVersionString to get the version number, which ended to be "3.1" instead of "3.1.8".

Sorry for the inconvenience and thanks for your help.

No problem! I just performed a test on my end and was about pose some questions around which string you were using.

Glad you sorted it out and thanks for using Siren!