我试图拦截/延迟App Store交易成功弹出一个交易成功,直到我收到收据后才能对收据ID,产品ID等进行一些验证。
但是,我似乎无法找到实际触发它的代码(我认为它是PaymentQueue中的内容)。
思想?
答案 0 :(得分:-1)
func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) {
println("Received Payment Transaction Response from Apple");
for transaction:AnyObject in transactions {
if let trans:SKPaymentTransaction = transaction as? SKPaymentTransaction{
switch trans.transactionState {
case .Purchased:
println("Product Purchased");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
break;
case .Failed:
println("Purchased Failed");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
break;
// case .Restored:
//[self restoreTransaction:transaction];
default:
break;
}
}
}
}