Bir ödeme yapabilir olmadığını kontrol etmeyi unutmayın : SKPaymentTransactionObserver
ve ardından yöntemini uygulamak: protokolü takip etmek zorunda iyiydi geri yüklerseniz kontrol için
if (SKPaymentQueue.canMakePayments()) {
SKPaymentQueue.default().restoreCompletedTransactions()
}
SKPaymentQueue.default().addTransactionObserver(self)
012: yaparak olaya
func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!)
ve abone
func paymentQueue(_ queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) {
print("Received Payment Transaction Response from Apple");
for transaction in transactions {
switch transaction.transactionState {
case .purchased, .restored:
print("Purchased purchase/restored")
SKPaymentQueue.default().finishTransaction(transaction as SKPaymentTransaction)
break
case .failed:
print("Purchased Failed")
SKPaymentQueue.default().finishTransaction(transaction as SKPaymentTransaction)
break
default:
print("default")
break
}
}
}
: Son olarak burada
Ben bir sonuç kontrol nasıl bir exemple olduğunu