skip to Main Content

I am using this version lookup API for checking the updated version:

https://itunes.apple.com/lookup?bundleId=xxx.yyyyy.zzz

The result is different when i call API from mobile app, Postman and AppStore

from code, it is showing old version in xcode debug 3.0.0: Xcode debug

In Postman it is showing correct version 4.0.0: enter image description here

In AppStore, it is also showing correct version 4.0.0: enter image description here

Why it is not showing correct version when i am calling API from xcode and mobile app?
I am using alamofire:

let bundleId = Bundle.main.infoDictionary!["CFBundleIdentifier"] as! String
AF.request("https://itunes.apple.com/lookup?bundleId=(bundleId)").responseJSON { [weak self] response in
    print(response.result)
}

2

Answers


  1. Looks like a caching problem. Try to execute request ignoring cache data

    Update: 14.10.2020

    let url = "itunes.apple.com/lookup?bundleId=(bundleId)" 
    var urlRequest = URLRequest(url: URL(string: url)!) 
    urlRequest.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
    
    Login or Signup to reply.
  2. I am facing the same issue and I tried urlRequest.cachePolicy but not working for me.

    Below thing is works for me please check URL carefully-

    This is my URL-

    "http://itunes.apple.com/lookup?bundleId=(bundleId)"
    

    I Changed with this-

    "https://itunes.apple.com/lookup?bundleId=(bundleId)"
    

    IF you can see in the first URL I used http and in the second URL, I use https.
    Please add HTTPS and then check it works.
    Cheers!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search