在SKProductsRequestDelegate中我收到以下错误:Error Domain = SSErrorDomain Code = 0“无法连接到iTunes Store”
根据我的发现,当产品标识符错误或Apple SandBox服务器关闭时,可能会发生这种情况.然而事实并非如此,因为产品在iOS 10上运行良好.
我对产品提取的实现与Apple guides中的实现非常相似
是否有其他人遇到此问题或找到解决方案?
当应用程序在物理设备上运行时,产品正在正常加载.
我正在使用Xcode 9.0.
这就是我的代码现在的样子:
- (voID)inquireProducts { _availableProducts = [NSMutableArray arrayWithCapacity:0]; NSURL *url = [[NSBundle mainBundle] URLForResource:@"productIDs" withExtension:@"pList"]; kNownProductIDentifIErs = [NSArray arrayWithContentsOfURL:url]; if (kNownProductIDentifIErs && kNownProductIDentifIErs.count) { // Keep a strong reference to the product request productsRequest = [[SKProductsRequest alloc]initWithProductIDentifIErs:[NSSet setWithArray:kNownProductIDentifIErs]]; productsRequest.delegate = self; [productsRequest start]; }}#pragma mark SKProductsRequestDelegate method- (voID)productsRequest:(SKProductsRequest *)request dIDReceiveResponse:(SKProductsResponse *)response { for (SKProduct *product in response.products) { [_availableProducts addobject:product]; } productsRequest = nil; [[NSNotificationCenter defaultCenter] postNotificationname:IAPPurchaseNotification object:self];}- (voID)request:(SKRequest *)request dIDFailWithError:(NSError *)error { if (request == productsRequest) { static int count = 0; NSLog(@"Request %@ Failed on %d. attempt with error: %@",request,++count,error); productsRequest = nil; // try again until we succeed [self inquireProducts]; }}总结
以上是内存溢出为你收集整理的SKProductsRequest无法在iOS 11模拟器中运行全部内容,希望文章能够帮你解决SKProductsRequest无法在iOS 11模拟器中运行所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)