I am using below code to retrieve list of products
-(void) viewWillAppear:(BOOL)animated
{
if ([SKPaymentQueue canMakePayments]) {
NSLog(@"Parental-controls are disabled");
//Request products.Retrieving list of products
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"com.test.SinFinder"]];
productsRequest.delegate = self;
[productsRequest start];
} else {
NSLog(@"Parental-controls are enabled");
}
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
SKProduct *validProduct = nil;
int count = [response.products count];
NSLog(@"count : %d",count);
if (count > 0) {
validProduct = [response.products objectAtIndex:0];
} else if (!validProduct) {
NSLog(@"No products available");
}
}
In handling response I am getting count zero and so in updatedTransactions methods it goes to SKPaymentTransactionStateFailed and logs error.
I have no idea what is going wrong or what is missing
Or Is this necessary i.e. list of products as I just need to lock a feature once app is purchased
try to print the products on gdb and if you find the products as invalid ,refer this link in that case.
refer this for a complete look of developing in app into our application
TNQ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With