我真的找不到任何详细的解释,但是如何从SwiftyStoreKit触发以下回调。
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
for purchase in purchases {
switch purchase.transaction.transactionState {
case .purchased, .restored:
if purchase.needsFinishTransaction {
// TODO: Set flags here that the user has now purchased the product
SwiftyStoreKit.finishTransaction(purchase.transaction)
}
// Unlock content
case .failed, .purchasing, .deferred:
break // do nothing
}
}
}
此外,如果您的应用正在从服务器下载内容,则仅需要调用finishTransaction?