Home > Back-end >  How to make account deletion on flutter firebase app?
How to make account deletion on flutter firebase app?

Time:06-22

I want to update my projects to meet apple's new requirements, so I need to know how to make this process if anybody knows please tell me

CodePudding user response:

There is delete method for Firebase user, see Delete a user for details.

CodePudding user response:

As you also want to delete the user-related documents, you will first have to run delete operations against Firestore for the documents you want to delete. As deleting many documents can be resource heavy, I would advise you to use a cloud function for deleting all user-related documents, more info here. After you have deleted all the documents that are related to a user, you can call the delete method on a user as pointed out by user18309290, or you can use the admin SDK if you are using, for instance, a cloud function.

If you decide to delete the user and all documents directly from the app, make sure that all the delete operations proceed successfully before deleting the user. If you have (and you should have) added firestore rules, the user will not be able to delete documents after the user's account is deleted.

You should also make sure that you define firestore rules for what documents a user can delete, if you decide to directly delete the documents from the client and not from a server.

  • Related