We use server-side validation to check our iTunes in app purchases. When the transaction is sent to the SKPaymentTransactionObserver server, we take the receipt from appStoreReceiptURL to check it.
if let receiptPath = NSBundle.mainBundle().appStoreReceiptURL?.path where NSFileManager.defaultManager().fileExistsAtPath(receiptPath), let receiptData = NSData(contentsOfURL:NSBundle.mainBundle().appStoreReceiptURL!) { return receiptData }
But in some cases, for example, when we restore purchases, we get several transactions to the method:
public func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
It seems rather strange to use the same receipt data to verify each transaction. Does one receipt have data about each transaction?
source share