gpt4 book ai didi

iOS - 如何延迟显示消息 "purchase was successful"以等待验证收据完成

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:06:13 25 4
gpt4 key购买 nike

我已经搜索过但找不到任何方法来延迟显示消息:“您的购买成功”等待验证收据完成。

我尝试引用行 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;
}
}
}
}

最佳答案

基本上没有办法延迟“购买成功”的消息。

但您可以在验证收据后显示额外的警报,向用户显示验证结果。

关于iOS - 如何延迟显示消息 "purchase was successful"以等待验证收据完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37274451/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com