iTunes 查找 API return 我 APP 中的旧数据

iTunes lookup API return old data in my APP

我的 APP 通过比较本地版本和远程版本 return 通过 iTunes 查找 API 检查更新。但是新版本发布后API还是return旧版本

https://itunes.apple.com/us/lookup?bundleId=com.xxx.xxxx

这个APIreturn新版本(4.9)如果我通过浏览器请求,但是return旧版本(4.8.1)在APP中。

有人帮忙吗?谢谢

- (void)updateAppInfo

{
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    //first check iTunes
    NSString *iTunesServiceURL = [NSString stringWithFormat:@"https://itunes.apple.com/us/lookup"];
    iTunesServiceURL = [iTunesServiceURL stringByAppendingFormat:@"?bundleId=%@", [[NSBundle mainBundle] bundleIdentifier]];
    NSLog(@"iRate is checking %@ to retrieve the App Store details...", iTunesServiceURL);

    NSError *error = nil;
    NSURLResponse *response = nil;
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:iTunesServiceURL] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60];
    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
    if (data && statusCode == 200)
    {
        //in case error is garbage...
        error = nil;
        id json = nil;
        if ([NSJSONSerialization class])
        {
            json = [[NSJSONSerialization JSONObjectWithData:data options:(NSJSONReadingOptions)0 error:&error][@"results"] lastObject];
        }
        else
        {
            //convert to string
            json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        }

        if (!error)
        {
            self.appStoreId = [self valueForKey:@"trackId" inJSON:json];
            self.latestVersion = [self valueForKey:@"version" inJSON:json];
            self.releaseNote = [self valueForKey:@"releaseNotes" inJSON:json];
        }
    }
    });
}

并非所有应用在所有国家/地区都可用。在您的 URL 中,在美国商店中寻找它。删除 /us/ 并尝试。

更多详情:iTunes search API won't show existing app info

我现在也遇到了同样的问题。我与另一位开发人员交谈,他得出的结论是这可能是 CDN 问题。 (内容分发网络)

  • 当我连接到我们的 wifi 时,响应已过时。
  • 当我连接到我的 4G 数据时,响应会更新。

我也遇到了同样的问题,但在我的情况下,我使用了 http(例如 http://itunes.apple.com/lookup?bundleId=com.xxx.xxxx) so not getting latest app version. Then I replaced http to https (https://itunes.apple.com/lookup?bundleId=com.xxx.xxxx),之后它对我有用。

更新-我们的团队给苹果开发者发了邮件,询问为什么https可以用而http不能用,得到了苹果团队的回复。他告诉"In general, there is a 24 hours delay for updated app information to go from App Store Connect to the public."

有关详细信息,请参阅他们的电子邮件回复-

我遇到了同样的问题。它有两个步骤来解决这个问题。

我使用的是 http://itunes.apple.com/lookup?bundleId="YOUR BUNDLE ID" 而不是 https.

第 1 步:请确保您使用的是 https 而不是 http,因为它不会为您提供更新的版本号。 首先,我上传了版本 1.8.0 然后是版本 1.9.0 然后是版本 1.9.1 .当我使用 http 时,它总是向我显示 1.8.0,甚至应用商店中的应用程序的版本为 1.9.1。因此,未来只需使用 https

第 2 步:上传最新版本后,请等待 24 小时,以便在 https://itunes.apple.com/lookup?bundleId="YOUR BUNDLE ID" 上获取最新版本。我得到的是 1.9.0 版本,尽管该应用程序在 24 小时内使用了 1.9.1 版本。我等了 24 小时,然后它开始给我正确的版本,然后我能够通过版本检查强制更新我的应用程序。

好的@Yunnosch 目前无法从此 url

获取 JSON 格式的应用程序信息

https://itunes.apple.com/lookup?bundleId=“您的捆绑 ID”。

因此我们需要用这个

来改变URL

新 URL 将 https://itunes.apple.com/lookup?id=“您的 Bundle id”

这只是在评论中通知最新的 url。