Question

Here is my situation: in my app I have a set of consumable in-app purchases. All purchases sent to server to be validated and activated. But there is a possibility to encounter situation when user performed a purchase (paid money) but something happens during purchase activation (lost connection, server error, etc). In result both app and server do not know about purchase (lets take situation that app lost purchase data for some reason). So I need to get user's purchases/transaction from app store.

I've tried [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; but it does not return consumable purchases.

Is there any way to get a list of all purchases/transactions from app store?

Was it helpful?

Solution

Two possibilities: 1) If the interaction fails with your server, don't finish the transaction (ie, don't remove the transaction from the queue). That way your transaction observer will get it again and you can try your server again. 2) Finish the transaction, but store enough info on the app (eg, NSUserDefaults) to try again with the server later. You can start a timer that will try again later.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top