static func checkStoreVersion(completion: @escaping (String?) -> Void) {
guard let url = URL(string: "https://itunes.apple.com/kr/lookup?bundleId=BUNDLEID") else {
return completion(nil)
}
let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
guard let data = data,
let json = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any],
let results = json["results"] as? [[String: Any]],
!results.isEmpty,
let appStoreVersion = results[0]["version"] as? String else {
return completion(nil)
}
return completion(appStoreVersion)
}
task.resume()
}
My app was already released 1.0.1.
And I’ve newly deployed 1.0.2 and it’s also showing up in the App Store update list.
However, if you use the code above to check the app version in the App Store, it still reads 1.0.1.
If you enter the URL directly into the Internet web browser and check the txt file, it comes out well as 1.0.2.
Why are you reading the old version on my app only?
It’s been five hours since my app was released.




