ios – iTunes查找API在我的APP中返回旧数据

我的APP通过比较iTunes查找API返回的本地版本和远程版本来检查更新.但新版本发布后,API仍会返回旧版本.

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

如果我通过浏览器请求,此API返回新版本(4.9),但在APP中返回旧版本(4.8.1).

有人帮忙吗?谢谢.

- (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];
        }
    }
    });
}

解决方法

我也面临同样的问题,但在我的情况下,我使用http(例如 http://itunes.apple.com/lookup?bundleId=com.xxx.xxxx),所以没有获得最新的应用程序版本.然后我将http替换为https( https://itunes.apple.com/lookup?bundleId=com.xxx.xxxx),之后它为我工作.

更新 – 我们的团队向苹果开发人员发送了邮件,并询问为什么https正在运行且http无效,并得到苹果团队的回复.他告诉“一般情况下,更新的应用信息会延迟24小时从App Store Connect发送给公众.”

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

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...