当我点击恢复购买按钮时,我收到了以下信息。这是我用于恢复购买的代码......请问是否有做错的地方?谢谢!顺便说一下,如果您需要更多信息或代码,请告诉我。
忽略restoreCompletedTransactionsWithApplicationUsername:因为已经在恢复交易
func RestorePurchases() {
if SKPaymentQueue.canMakePayments() {
SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
} else {
println("Can't make purchases")
}
}
func paymentQueueRestoreCompletedTransactionsFinished(queue: SKPaymentQueue!) {
var purchasedItemIDS = []
for transaction in queue.transactions {
var t: SKPaymentTransaction = transaction as! SKPaymentTransaction
let prodID = t.payment.productIdentifier as String
switch prodID {
case "unlockLevelTwo":
println("restoreleveltwo")
unlockLevelTwoPlease()
case "unlockLevelThree":
println("restorelevelthree")
unlockLevelThreePlease()
default:
println("IAP not setup")
}
}
}
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
var touch: UITouch = touches.first as! UITouch
var location = touch.locationInNode(self)
var node = self.nodeAtPoint(location)
if node.name == "restore" {
runAction(menuAudioPlayer)
RestorePurchases()
}