SKProductsRequest返回空结果 [英] SKProductsRequest Returning Empty Results

查看:847
本文介绍了SKProductsRequest返回空结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经查看了其他一些答案,但它们似乎对我的情况没有帮助。我有一个新的应用程序,几乎已准备好初始版本,我正在处理In App Purchase部分。我在之前的应用程序中使用过IAP,所以我认为移动应该是直截了当的。但问题是,每当我运行SKProductsRequest时,它都会返回一个空结果集。

I have looked over some of the other answers and they don't seem to help my situation. I have a new app that is nearly ready for its initial release and I am just working on the In App Purchase section. I have used IAP in a previous app so I thought the move over should be straight forward. The problem is, however, that whenever I run SKProductsRequest, it returns an empty results set.

我使用以下命令发出请求

I am using the following to make the request

productIdentifierList = [[NSMutableArray alloc] init];
[productIdentifierList addObject:[NSString stringWithFormat:@"xxxxxxxxxx"]];

SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:productIdentifierList]];

并且回复转到

-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
    NSLog(@"Recieved Product Response %@",response.products);
    [productDetailsList addObjectsFromArray: response.products];
    [productDisplayTableView reloadData];
}

我似乎没有得到任何结果。我检查了ID,看起来没问题;我也通过Xcode从我的iPhone设备运行,但仍然没有运气。调试器中的响应也没有给出很多。

I just don't seem to be getting any results returned. I have checked the ids and they seem ok; I have also run from my iPhone device via Xcode and still had no luck. The response in the debugger doesn't give a lot away as well.

有人可以为这个问题提出一些修正建议吗?

Can anyone suggest some fixes for this issue?

推荐答案

事实证明,在新版本的IOS中,您不再需要输入应用程序的完整ID,然后输入iap id。而只是放入iap id。

It turns out that in new versions of IOS you no longer need to put in the full id of the app and then the iap id. Instead just put in the iap id.

[productIdentifierList addObject:[NSString stringWithFormat:@"iap_id"]];

这篇关于SKProductsRequest返回空结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆