1
我已經搜索並找不到任何方式來創建延遲顯示消息:「您的購買成功」等待直到驗證收據完成。iOS - 如何延遲顯示消息「購買已成功」,等待驗證收據完成
我試過引用該行SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
,但該消息仍然激發。
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
print("Received Payment Transaction Response from Apple");
for transaction:AnyObject in transactions {
if let trans:SKPaymentTransaction = transaction as? SKPaymentTransaction{
switch trans.transactionState {
case .Purchased:
print("Product Purchased");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
// validate receipt and update money
validateReceipt(trans.payment.productIdentifier)
break;
case .Failed:
print("Purchased Failed");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
self.indicator.Hide()
break;
case .Restored:
print("restored")
SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
//[self restoreTransaction:transaction];
self.indicator.Hide()
break;
default:
break;
}
}
}
}
Tks,我也這麼認爲,但沒有人確認。 – TomSawyer
有人想過這個!?我也實施了收據驗證,並且在收據驗證返回爲欺詐時收到「您已全部設置」成功消息會引起混淆!無論如何要抑制這個消息,直到驗證收據之後? – Learn2Code
沒有這樣的方式。在驗證之後,您必須依賴額外的消息將最終狀態傳達給用戶。 –