【发布时间】:2016-01-05 21:57:35
【问题描述】:
我们正在使用服务器端验证来验证我们在应用程序中购买的 iTunes。当交易发送到 SKPaymentTransactionObserver 时,我们会从 appStoreReceiptURL 获取收据以进行验证。
if let receiptPath = NSBundle.mainBundle().appStoreReceiptURL?.path where
NSFileManager.defaultManager().fileExistsAtPath(receiptPath),
let receiptData = NSData(contentsOfURL:NSBundle.mainBundle().appStoreReceiptURL!) {
return receiptData
}
但在某些情况下,比如我们在恢复购买时,接收到多个交易的方法:
public func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
使用相同的收据数据来验证每笔交易似乎很奇怪。单张收据是否包含有关每笔交易的数据?
【问题讨论】:
标签: ios swift in-app-purchase storekit