即使我试图恢复我的购买,并取消后,第一步,它仍然会解锁我的优质炉灶。虫子在哪里?

 @IBAction func restorePurchase(sender: UIButton) {
        SKPaymentQueue.defaultQueue().addTransactionObserver(self)
        SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
    }

func paymentQueueRestoreCompletedTransactionsFinished(queue: SKPaymentQueue) {
        for transaction in queue.transactions {
            let t: SKPaymentTransaction = transaction

            let prodID = t.payment.productIdentifier as String

            switch prodID {
                case "xxxxxxxxxxxx":
                    purchaseedVoid()
                default:
                    print("IAP")
            }
        }
    }

最佳答案

检查Ray's tutorial about IAP。我用他的采购助手代码来管理我所有的IAP。它就像一个符咒

关于xcode - 恢复应用内购买失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37949816/

10-11 02:21