I have a use case where I am able to reproduce this.
- The app store has a new app 1.2.0 version recently available (<24 hours)
- I'm on version 1.1.0 and I am receiving 1.2.0 version from the itunes lookup API
- I update the app via app store
- I will reinstall 1.1.0 from xCode to my device
- I'm on version 1.1.0 and I am receiving the previous 1.1.0 version from the itunes lookup API
I noticed if I change the cache policy from reloadIgnoringLocalAndRemoteCacheData to reloadRevalidatingCacheData it will show 1.2.0 on step 5 but why is this the case?
let iTunesURL = URL(string: "https://itunes.apple.com/lookup?bundleId=\(bundleId)")
guard let url = iTunesURL else {
return nil
}
let urlRequest = URLRequest(url: url, cachePolicy: .reloadRevalidatingCacheData)
let (data, _) = try await URLSession.shared.data(for: urlRequest)