I am working with IAP, I want to get the receipt so that I can validate it.
I have tried this
-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
for (SKPaymentTransaction *transaction in transactions) {
switch (transaction.transactionState)//Each transaction should be processed by examining transactionState property.
{
case SKPaymentTransactionStatePurchased:
{
if([transaction.payment.productIdentifier isEqualToString:@"TC0001"])
{
}
**NSData *data = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSError *error;
NSDictionary *response = [NSJSONSerialization JSONObjectWithData: data options: 0 error: &error]; //I am using sbjson to parse
NSLog(@"%@",response);**
//Finish transaction deletes the transaction from the default queue
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
}
break;
default:
break;
}
}
}
I hope I am doing right, because this is what mentioned in docs. But I get "null for response. So is that I am missing something.