I'm looking to add receipt validation to the in app purchase in my app. The in app purchase basically just unlocks a "pro" version of the app that provides the users with some extra features, such as a dark mode. I'm reading a lot about the in app purchase receipt validation flow, and it's a lot to take in.
Am I doing this right? When the user makes their purchase, I send the resulting receipt off to my server, and validate it with Apple. If Apple "okays" the receipt, and it matches the bundle ID for my app, then I return "true" back to my app from my server, and now my app knows whether the receipt is valid.
1. Is this flow correct? What's stopping them from faking my server's "true" response?
2. What do I do now that I know that receipt is valid? I obviously don't set a flag in NSUserDefaults (they could tamper), so how do I know fifteen minutes later when the user tries to use dark mode that they are a paid user with a valid receipt? Just check for the presence of a receipt, and if so, how do I know that the receipt found is valid, surely I don't check server-side for validity every time the feature is accessed? What about at app launch, should I check every time there? What if I check at launch, see no receipt, infer that they're not a "pro" user, and then five seconds later a jailbreak tweak attaches a fake receipt, the user tries to enable the mode, I see a receipt, and just give it to them?
I'm really mostly confused/concerned about number 2? Basically, after establishing a receipt is valid and they're a pro user, how do I keep that information?