Daily iOS
Security

Verifying purchases

A webtoon app unlocks paid episodes through in-app purchase. What's wrong with a design where the client saves a "purchased" flag in UserDefaults after a successful payment and unlocks from that?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Anyone can flip a UserDefaults flag to true on a jailbroken device or by editing a backup, it disappears on reinstall or on another device, and a refund can't undo it, so the unlock has to come from a server that verified the signed StoreKit Transaction and keeps an entitlement per account.

Share a question