239
in-app purchase
also StoreKit, Play Billing
The store charges the user. Your server decides what that unlocked.
What is in-app purchase?
An in-app purchase goes through StoreKit or Play Billing. The client starts the purchase and shows the pending state. The server verifies the transaction before granting anything. Restore must work on a new phone. A boolean in local storage is not a receipt.
Why does in-app purchase matter when vibe coding?
The draft sets premium to true when the button returns. There is no server check, no restore, and no handling for a purchase that is pending parental approval.
How do you do in-app purchase?
Server verification. Idempotent grant. Restore on launch. Handle pending, cancelled, and refunded. Do not unlock from the client alone.
How do you ask a model for in-app purchase?
Sell (product) with StoreKit or Play Billing. Verify the transaction on the server before granting it. Support restore. Do not set a local premium flag from the client.
What goes wrong with in-app purchase?
Finishing the transaction before the grant is stored. The store will not deliver it again, and the user paid for nothing.