2012-01-28 90 views
2

正如标题所示, 当请求一个SKProducts的列表并从模拟器运行时,我会得到正确的数组,但是在实际的iPhone上,数组将包含0个项目。iOS应用内SKProduct没有显示在iPhone上,但在模拟器中做

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

它在模拟器中不起作用。 – samfisher 2012-01-28 06:09:26

+0

它适用于我的模拟器 – ssj 2012-01-28 06:13:14

+0

您需要确保设备使用正确的软件包标识符,并注册到itunesconnect应用程序中。这可能是最强有力的原因。 – samfisher 2012-01-28 06:16:08

回答

1

如果它工作在模拟器(不知道如何??),但不是在phone..then问题只能解释的。如果你的设备是越狱。

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

按照上面的链接,包括对NSLog的无效产品标识.. 如果收到登录.the网站提供的各类案件中,它发生,这样就可以解决添

+0

问题是越狱! – ssj 2012-01-29 03:24:40

相关问题