1
votes

Providing content for my non-consumable item is not happening immediately after purchase but on demand, whenever user would like to download content. Server has receipt validation routine as well, so I need to save receipt to later show to server for validation and content downloading.

I know that for iOS 7.0 I don't have to store receipt, because my iAP purchase receipts are located in app receipt itself, which is not hard to parse and get that information.

But for iOS 6.1 or earlier, can I save receipt from transaction in NSUserDefaults so later when I need to for instance download some content from self-hosted server, I can use that receipt to validate that particular download on server(and then server will send it to apple)? Is it legit, safe and common practice to store receipt?

1

1 Answers

2
votes

I am pretty sure you already went through the following link

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9

Apart from that, I believe there is no problem in saving the transaction data. As for saving it in NSUserDefaults, there is one problem with that I can think of: If the user deletes and reinstalls the app, or buys a new phone, that data will not be stored on the device. Therefore saving the receipt in some way in YOUR self-hosted server would be better. For pre iOS7 devices, the link mentions this technique:

"If you need to support versions of iOS earlier than iOS 7, where the app receipt isn’t available, restore completed transactions instead."