简体   繁体   中英

restoreCompletedTransactions never calls updatedTransactions in StoreKit

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.

paymentQueue:updatedTransactions: is only called when the state of transactions has changed.

If there are no previous transactions [[SKPaymentQueue defaultQueue] restoreCompletedTransactions] will not change the state of these transactions (because there are none) so paymentQueueRestoreCompletedTransactionsFinished is called without a call to paymentQueue:updatedTransactions:

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?

You need to call [[SKPaymentQueue defaultQueue] finishTransaction:] after handling a successful transaction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM