恢复应用内购买失败

时间:2016-06-21 16:27:02

标签: xcode swift in-app-purchase

即使我尝试恢复购买并在第一步后取消它仍然会解锁我的高级stoff。错误在哪里?

 @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")
            }
        }
    }

1 个答案:

答案 0 :(得分:0)

检查Ray's tutorial about IAP。我使用他的购买帮助程序代码来管理我的所有IAP。它就像一个魅力