[ what method will call while click the cancel button in the inapppurchase? ]
I am developing the application with InAppPurchase.Now i have the problem,
what method will call ,while click the cancel button in the above image?
anyone please help me.
Thanks advance.
Answer 1
by using this method you will get the state of the transaction
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction:AnyObject in transactions {
if let trans:SKPaymentTransaction = transaction as? SKPaymentTransaction{
switch trans.transactionState {
case .Purchased:
SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
break;
case .Failed:
SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
break;
// case .Restored:
//[self restoreTransaction:transaction];
default:
break;
}
}
}
}