Basically I am trying to make the in-app purchase work, but with no luck. Here is my code for requesting a product purchase
- (void)requestProductData
{
NSSet *productIdentifiers=[NSSetsetWithObject:productid];
request5= [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject: productIdentifiers]];
request5.delegate = self;
[request5 start];
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
myProducts = response.products;
for (NSString *invalidProductId in response.invalidProductIdentifiers)
{
NSLog(@"Invalid product id: %@" , invalidProductId);
}
SKProduct *selectedProduct = [myProducts objectAtIndex:0];
SKPayment *payment = [SKPayment paymentWithProduct:selectedProduct];
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
The strange thing is that both response.products and response.invalidProductId have 0 objects in them.I’ve already tried things like checking the Provisioning Profile, the appID, the bundle ID and so on. Also, almost 24 hours have passed since I added the in-app purchase in itunes connect. Can anyone help me?
Check the code for making the request. You have:
It should be:
You are creating a set with one object – another set with the product id.