If your app allows users to create an account, you should also given them an easy way to close their account and delete all associated data.
Deleting user accounts in Firebase is pretty straight-forward - all you need to do is to call
However, while this will delete the user's account, it will not delete any data the user might have stored in your app (e.g. in Cloud Firestore, Cloud Storage, or the Realtime Database).
Another thing you need to consider when deleting user accounts is revoking their access / refresh tokens if they used Sign in with Apple to create their account.
The good news is that Firebase makes deleting user data and revoking their tokens easy:
- Instead of writing code that iterates over all of the user's data on the client, you can use the Delete User Data Extension, which has a bunch of configuration options that allow you to adjust it to your data model - see the [documentation].(https://firebase.google.com/docs/extensions/official/delete-user-data)
- We've also implemented a
revokeToken method on the
User type, to make it easy to revoke the user's Sign in with Apple access / refresh tokens and comply with Apple's account deletion requirements.
In this video, I show you how to implement this in a SwiftUI app. I made sure to not just show the code, but also walk through the process of configuring your app in the Firebase console and Apple's developer portal. Enjoy!
On November 21st, we hosted a special edition of #AskFirebase Live on Twitter Spaces. I had the honour of being the host, and was joined by a bunch of SWEs, PMs, and DREs from around the Firebase team.
We got plenty of questions about the features we announced at Firebase Demo Day, and of course about other topics as well.
So, if you ever wanted to know if there is any advanced tooling coming up for Firebase Analytics and Crashlytics, how to get access to Duet AI in Firebase, how to manage your Firebase projects with Terraform, or how to use the new AI features in Firebase, check out the recording for answers to these and many other questions.
Also, please let me know if you'd like us to do more of these, and which topics you're most interested in - just reply to this email.