尝试发送 SKProductRequest 时出现无法连接到 iTunes Store 错误

发布于 2024-10-31 23:55:20 字数 1090 浏览 1 评论 0原文

在创建并初始化对象后,我调用了“SKProductsRequest”类的“start”方法。该对象的委托定义 productsRequest:didReceiveResponse: 方法和 request:didFailWithError: 方法。调用方法 request:didFailWithError: 后,我收到一条错误消息“无法连接到 iTunes Store”。 .我的代码如下:

-(IBAction)sendProductInfoRequest{
NSLog(@"sendProductInfoRequest");
NSSet *identifiersSet=[NSSet setWithObject:[NSString stringWithFormat:@"%@",@"com.hurix.Kitaboo.07APRIL201101"]];
SKProductsRequest *productRequest=[[SKProductsRequest alloc] initWithProductIdentifiers:identifiersSet];
productRequest.delegate=self;
[productRequest start];
NSLog(@"completing sendProductInfoRequest");

}

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error{
NSLog(@"request didFailWithError");
NSLog(@"The product request didFailWithError: %@",[error localizedDescription]);

}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
NSLog(@"yoooo!");
NSLog(@"The product request didReceiveResponse :%@",[response description]);

}

I have called "start" method of the "SKProductsRequest" class after creating and initializing object for the same.The delegate of this object is defining productsRequest:didReceiveResponse: method and request:didFailWithError: method. After the method request:didFailWithError: is called i'm getting an error saying "Cannot connect to iTunes Store".
.My code is as follows:

-(IBAction)sendProductInfoRequest{
NSLog(@"sendProductInfoRequest");
NSSet *identifiersSet=[NSSet setWithObject:[NSString stringWithFormat:@"%@",@"com.hurix.Kitaboo.07APRIL201101"]];
SKProductsRequest *productRequest=[[SKProductsRequest alloc] initWithProductIdentifiers:identifiersSet];
productRequest.delegate=self;
[productRequest start];
NSLog(@"completing sendProductInfoRequest");

}

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error{
NSLog(@"request didFailWithError");
NSLog(@"The product request didFailWithError: %@",[error localizedDescription]);

}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
NSLog(@"yoooo!");
NSLog(@"The product request didReceiveResponse :%@",[response description]);

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演出会有结束 2024-11-07 23:55:20

通常它非常快,最多几秒钟。我猜你是在沙箱环境中执行此操作,我发现沙箱环境有时非常不可靠且无响应。我不会太担心,几个小时后再试一次。

Usually it's really fast, couple of seconds at most. I'm guessing you're doing this on the sandbox environment, which I found really unreliable and unresponsive at times. I wouldn't worry too much about it and try again in a few hours.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文