I've been banging my head against the wall for a few days with this, since everything used to work fine, but now that I've moved to Mountain Lion
, XCode 4.5
and iOS5.1
and iOS6
, this issue came along and I thought it might be related to the configuration switch.
I call [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
and moments later paymentQueueRestoreCompletedTransactionsFinished
is called, but there is no sign of any call to updatedTransactions
. It's like the request got lost in space.
I'm also having a possibly related problem with purchases. If I try to repurchase an item using makePurchase, which from what I understand should also lead to a SKPaymentTransactionStateRestored, I get the "Already purchased.. download"
message followed by the dreaded "Cannot connect to iTunes store..."
with a "PaymentTransactionStateFailed"
error code 2. What is error code 2?
The item is a normal non-consumable in-app puchase, and this happens when testing the StoreKit
in sandbox mode.
I'm seeing others on this forum with similar issues with the only reply being that this is an intermittent bug i the StoreKit. Is this still the most plausible case?
Any news on this would be appreciated.
If you clear the purchase history more info here, or the user has never made a purchase before. paymentQueue:updatedTransactions
will never be called. You need to add paymentQueueRestoreCompletedTransactionsFinished
. Also to be sure check
queue.transactions.count == 0
All code here:
public func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {
print("paymentQueueRestoreCompletedTransactionsFinished",queue.transactions.count)
if queue.transactions.count == 0 {
//call FailedNotification
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With