Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios SKProductsRequest返回空结果_Ios_Xcode_Ios5_In App Purchase - Fatal编程技术网

Ios SKProductsRequest返回空结果

Ios SKProductsRequest返回空结果,ios,xcode,ios5,in-app-purchase,Ios,Xcode,Ios5,In App Purchase,我已经看过了其他一些答案,但它们似乎对我的情况没有帮助。我有一个新的应用程序,它几乎准备好了首次发布,我只是在工作的应用程序内购买部分。我在以前的应用程序中使用过IAP,所以我认为移动应该是直接的。然而,问题是,每当我运行SKProductsRequest时,它都会返回一个空的结果集 我正在使用以下内容提出请求 productIdentifierList = [[NSMutableArray alloc] init]; [productIdentifierList addObject:[NSSt

我已经看过了其他一些答案,但它们似乎对我的情况没有帮助。我有一个新的应用程序,它几乎准备好了首次发布,我只是在工作的应用程序内购买部分。我在以前的应用程序中使用过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];
}
我只是没有收到任何返回的结果。我已经检查了身份证,它们看起来还可以;我也通过Xcode从我的iPhone设备上运行,但仍然没有运气。调试器中的响应也不会泄露太多信息


有人能为这个问题提出一些解决方案吗?

事实证明,在新版本的IOS中,你不再需要输入应用程序的完整id,然后输入iap id。相反,只需输入iap id即可

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

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