SwiftyStoreKit
SwiftyStoreKit copied to clipboard
!!!!Some Questions about deferred case, PaymentsController.swift line 130
Question
Why payments.remove(at: paymentIndex) in deferred case? Why not handle like purchasing case? Here some info about deferred case:
- when in deferred case, Apple sample code comment that "Do not block the UI. Allow the user to continue using the app"
- So in deferred case, Discussion comment that "Update your UI to show the deferred state, and wait for another callback that indicates the final status."
- in deferred case, wait for parent to agree or disagree for this payment final status , or wait for 24h to failed case callback finally.
// PaymentsController.swift line 130
if transactionState == .deferred {
let purchase = PurchaseDetails(productId: transactionProductIdentifier, quantity: transaction.payment.quantity, product: payment.product, transaction: transaction, originalTransaction: transaction.original, needsFinishTransaction: !payment.atomically)
payment.callback(.deferred(purchase: purchase))
// why payment removed?
payments.remove(at: paymentIndex)
return true
}
@bizz84