When to call finishTransaction on SKPaymentQueue in Server Product Model?

1.1k Views Asked by At

I'm a little confused on when exactly to call:

[[SKPaymentQueue defaultQueue] finishTransaction:transaction]; in a 'Server Product Model': http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Art/store_transactions.jpg

Should it be called when my server returns me that receipt is valid and I can display paid content or should I call it immediately after I get back receipt (purchased or restore) from itunes ?

Thanks

2

There are 2 best solutions below

1
On

It should be called when your server returns that receipt is valid and paid content is displayed.

0
On

You should call it when the server has examined the receipt. If you call finishTransaction too early and your app crashes or the internet connection goes down before your server records the purchases, then the customer's money is gone, but you are not delivering the goods. If the receipt isn't valid, then the receipt doesn't come from Apple. It probably doesn't hurt to call finishTransaction.