正如标题所示, 当请求SKProducts列表并从模拟器运行时,我会得到正确的数组,但是在实际的iphone上,数组将包含0个项目。
NSSet *productSet = [NSSet setWithObject:@"com.somewebsite.someapp.inappproduct"];
SKProductsRequest *pr = [[SKProductsRequest alloc]initWithProductIdentifiers:productSet];
pr.delegate = self;
[pr start];
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
#pragma mark - purchasing
- (void)productsRequest:(SKProductsRequest *)request
didReceiveResponse:(SKProductsResponse *)response
{
NSLog(@"response = %@",response.products);
if (response.products.count > 0)
{
self.products = response.products;
[thetable insertSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationFade];
}
}
答案 0 :(得分:1)
如果它在模拟器中工作(不知道怎么做?)而不是在手机上......那么问题只有在您的设备被越狱时才能解释。
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
按照上述链接并包含NSLog for Invalid product identifiers .. 如果您获得该日志。该站点提供了发生它的各种情况,以便您可以解决时间