Is there a fast replacement for deprecate `SKPaymentTransaction.transactionReceipt`?

deprecated, in-app-purchase, ios, ios7

Solution

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];
    }
}

Problem

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]; } } ```

Original source