Reputation: 2940
I am signing users using anonymous and email authentication methods. I am storing the user data in Realtime Database. The data gets stored fine. I am also storing the FCM token to send cloud messages.
But I want to remove the users and some data in the Database for users that no longer have my app installed.
How can I accomplish that?
Upvotes: 2
Views: 1910
Reputation: 317958
You can't do this. An uninstall doesn't necessarily mean that the user won't come back into your app. For example, they could be temporarily freeing up space. Or it could have been a simple accident. Or, they're switching to a new device and want to remove it from the old device. It would be a terrible user experience if their profile data was deleted in any of these cases.
You may instead want to clean up space from old users by recording the last time they launched the app, then pruning data from users who haven't used your app in a long time.
Upvotes: 3