SKProductsRequest Returning Empty Results

萝らか妹 提交于 2019-12-23 19:08:09

问题


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]];

And the response goes to

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

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?


回答1:


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"]];


来源:https://stackoverflow.com/questions/15204511/skproductsrequest-returning-empty-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!