【发布时间】:2012-01-28 06:07:40
【问题描述】:
正如标题所示, 当请求 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];
}
}
【问题讨论】:
-
它在模拟器中不起作用。
-
它适用于我的模拟器
-
您需要确保对于设备,您使用的是在 itunesconnect 应用程序中注册的正确捆绑标识符。这可能是最强有力的原因。