The correct answer should be:
[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]]
And the full code:
- (void)recordTransaction:(SKPaymentTransaction *)transaction {
if ([transaction.payment.productIdentifier isEqualToString:[self getProductId:gFullVersion]]) {
[[NSUserDefaults standardUserDefaults] setValue:[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]] forKey:[self getProductId:gFullVersion]];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
source
share