Is there a fast replacement for deprecate SKPaymentTransaction.transactionReceipt?
The full code:
// saves a record of the transaction by storing the receipt to disk
- (void)recordTransaction:(SKPaymentTransaction *)transaction {
if ([transaction.payment.productIdentifier isEqualToString:[self getProductId:gFullVersion]]) {
// save the transaction receipt to disk
[[NSUserDefaults standardUserDefaults] setValue:transaction.transactionReceipt forKey:[self getProductId:gFullVersion]];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
The correct answer should be:
[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]]
And the full code:
// saves a record of the transaction by storing the receipt to disk
- (void)recordTransaction:(SKPaymentTransaction *)transaction {
if ([transaction.payment.productIdentifier isEqualToString:[self getProductId:gFullVersion]]) {
// save the transaction receipt to disk
[[NSUserDefaults standardUserDefaults] setValue:[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]] forKey:[self getProductId:gFullVersion]];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
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