0 Replies
      Latest reply on Nov 4, 2019 8:49 PM by 0427hjy
      0427hjy Level 1 Level 1 (0 points)

        Hello i develop my app which has version check function.

         

        When my app get version with source code on App Store, verison is previous version and all data are too,

         

        but my app's version distributed on App Store is 1.34.

         

        I checked the version with url on Chrome Web Browser, and it was 1.34.

         

        url: http://itunes.apple.com/lookup?bundleId=smart.edutrack.co.kr

         

        What's wrong with this?

         

         

        Here's my source code.

        ----------------------------------------------------------------------

        guard

         

                    let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,

         

                    let url = URL(string: "http://itunes.apple.com/lookup?bundleId=smart.edutrack.co.kr"),

         

                    let data = try? Data(contentsOf: url),

         

                    let json = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any],

         

                    let results = json?["results"] as? [[String: Any]],

         

                    results.count > 0,

         

                    let appStoreVersion = results[0]["version"] as? String

         

                    else { return false }

                print(results)

                print("presentVersion: \(version)")

                print("appStoreVersion: \(appStoreVersion)")

                if !(version == appStoreVersion) { return true }

        ----------------------------------------------------------------------