SKProductsRequest 返回空结果

3
我已经查看了其他答案,但它们似乎不能解决我的问题。我有一个即将发布的新应用程序,正在处理应用内购买部分。我之前在一款应用程序中使用过IAP,所以我认为移植应该很简单。然而,问题是每当我运行SKProductsRequest时,它都返回一个空的结果集。
我使用以下代码进行请求:
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,它们看起来没问题;我也从我的iPhone设备通过Xcode运行,但仍然没有运气。调试器中的响应也没有提供很多信息。

有人可以为这个问题提供一些解决方案吗?

1个回答

1
在新版本的IOS中,您不再需要输入完整的应用程序ID和IAP ID,而只需输入IAP ID即可。
[productIdentifierList addObject:[NSString stringWithFormat:@"iap_id"]];

1
@ORStudios - 能否详细解释一下这个答案呢?产品标识符应与在iTunes Connect中显示的标识符相匹配。通常是这样com.companyname.appname.iapreference - 我也遇到了同样的问题,但不确定是否相关,因为答案对我来说没有意义。谢谢。 - StuartM

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接