When does this show up? (and why it catches you off guard)
The moment is always the same and it always hurts: you finish your app, submit it for App Store review… and it gets rejected over rule 5.1.1. It catches you off guard because the AI, while building, focuses on the flow to create an account and use the app — it almost never thinks about the flow to delete it. It's a legal and an Apple requirement that you have to ask for yourself, explicitly, before publishing.
The trap that sinks you TWICE
The correct way · soft delete + anonymization
Here's the balance that actually works. The real technical problem is: if you delete the user "the brute-force way," your database breaks (their orders, comments, etc. end up pointing to a user that no longer exists). The professional solution: you truly delete the personal data (name, email, photo, phone) but you leave an anonymous shell in its place so the relationships don't break. The personal stuff is gone forever; your database integrity stays intact.
The 3 pieces Apple and the law require
- A "Delete my account" button that's easy to find, inside the app (typically in Settings).
- Actual deletion of the personal data: name, email, photo, phone — anonymized irreversibly.
- Deletion in the authentication system too (not just in your users table — also in Supabase Auth / the login provider).
Master prompt · ask your AI for it
This prompt asks your AI for everything needed to comply with the rule and the law, without breaking your database. Copy it and paste it in:
Implement account deletion for my app, complying with Apple's rule 5.1.1 and GDPR/CCPA. My stack: [tell it your stack, e.g. Supabase + Next.js]. 1. Create the "Delete my account" button inside Settings, easy to find. 2. Before deleting, show a clear confirmation (this is irreversible) and, if you want, ask to verify identity (a code via email/phone). 3. Do a SOFT DELETE with irreversible ANONYMIZATION of the personal data: name, email, photo, phone. Don't hide them: replace them with anonymous values (e.g. "deleted user") or NULL. 4. Leave a shell so the foreign keys don't break (their orders/comments must not blow up). 5. Delete the identity in the auth system too (e.g. Supabase Auth admin deleteUser), not just in my table. 6. If the user has an active SUBSCRIPTION, warn them BEFORE deleting and tell me how to handle the cancellation so you don't keep charging them or lose the billing record the law requires you to keep. 7. Log in an audit trail that the account was deleted (without personal data) in case the law requires proof. Give me the migration, the anonymization function and the button component, and explain in simple steps what each part does.
The case almost nobody handles · subscriptions
How to confirm it came out right
- The button is easy to find inside the app (not hidden on an external website).
- After deletion, the personal data no longer exists in your database (verify it by hand).
- The user also disappears from the auth system (they can't log in again).
- The things they left behind (orders, comments) didn't break anything — they still show an anonymous author.
- If there was a subscription, it got canceled and the accounting record remains without personal data.