Good methods of retaining In App Purchase info

I want to implement an In App Purchase to turn on extra features in my app. I will build these features into the app but have them disabled/invisible until the purchase is made. The basic method I have thought of is to save a file containing in app purchase true/false which is read at app startup. If file contains true then the extra features are enabled/visible.
Expanding on the basic idea it seems that this file should be encrypted in some way. Any suggestions as to the seed number source?
Another issue is when the user gets a new device and installs the app, the app must ask for a restoreCompletedTransactions. I am sure that Apple doesn’t want the app to do that every time it starts. Any suggestions as to a good way to determine when this function is required?
Or are there much better methods overall that are common? I don’t want to use the Apple feature update server for this simple case.

The “recommended” way of doing this is to store the yes/no values in NSUserDefaults. When a new purchase is made, you add it to the list of items they have purchased. You can also save a value indicating you have checked for restored purchases and only check at app startup if this value is not present. I’m guessing you are using my iAP classes in iOSKit, NSUserDefaults is contained in the Foundation module there and is pretty straightforward to use, the only gotcha is to make sure you call synchronize after saving so the new value is committed.

Hey Jason, I know I’m digging in old threads. Just a quick question: is your answer here still the recommended way of doing it? And would you have a sample project in the meantime to see how it’s done?

In general, can a user request a refund for an in-app purchase? And if so, how will my app know? I’m asking because I plan to have an in-app purchase for the full version of my app and I’d like to avoid the user buying the full version, then requesting a refund while still being able to use all the full version features.

Users can ask for a refund for any purchase.
You will not be notified in case of refund, the premium features of the app will unfortunately continue to be unlocked.
However, Apple announced for iOS 14 that server notifications will be sent to the developer for each refund.
I have no further information about this at the moment. You will need to do some digging.

You are technically able to see if a purchase was refunded by inspecting the receipt. I don’t think there is any Xojo code to do that though. The steps are to refresh the receipt when you launch your app, then look for the cancelled_date field for the purchase in the receipt. If that field is present then it was refunded and you can disallow access to the premium features.

I think you will probably find that the effort to validate this is not going to pay back anything - getting a refund from Apple is very rare and having the ability to detect a refund isn’t going to make users more likely to use the app.

My refund rate for Packr is less than 1%.

Unless you are offering a premium service that actually costs you money each time it is used I don’t think it is worth it to make sure that refunds don’t have access to premium anymore.

Thanks Jeremie & Jason for your responses. Sounds good for me, no need to put additional work into that.