The iTunes API lookup does not synchronise the current app store

390 views Asked by At

I have a function to call the iTunes API lookup to check the current version on App Store, but the response is always delayed.

func getInfoFromAppStore(_ success: @escaping (_ json: [String: Any?]) -> Void) {
    guard let url = URL(string: "https://itunes.apple.com/lookup?id=xxxx") else {
        return
    }
    session.dataTask(with: url) { (data, urlResponse, error) in
        guard let data = data, error == nil else {
            return
        }

        let responseObject = try? JSONSerialization.jsonObject(with: data, options: [.allowFragments])
        if let json = responseObject as? [String: Any?] {
            success(json)
        }
    }.resume()
}

By exemple: If the old version was 1.0.0, when I uploaded the app 1.0.1 and download it from app store within 2 hours, the version I got from the response json is still 1.0.0. I guess because the server will synchronise all regions...

Is there any way to get the information of the app store associated?

0

There are 0 answers