iOS 应用内 SKProduct 未显示在 iPhone 上,但在模拟器中显示
正如标题所示, 当请求 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];
}
}
As the the title suggests,
When requesting a list of SKProducts and running from the simulator, i would get the correct array, however on the actual iphone, the array would contain 0 items.
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];
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它在模拟器中有效(不知道如何?)但在手机上无效......那么只有当您的设备已越狱时才能解释问题。
http://troybrant.net/blog/2010/ 01/in-app-purchases-a-full-walkthrough/
点击上面的链接并包含无效产品标识符的 NSLog。
如果您收到该日志,该站点会提供发生该情况的各种情况,以便您可以解决问题
If it works in the simulator(don't know how??) but not on the phone..then the problem can only be explained if your device is jailbroken.
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
Follow the above link and include the NSLog for Invalid product identifiers..
If you get that log .the site provide the various cases in which it occurs so that you can solve tim