Environment: [Expo Managed Flow: SDK 38]
I am storing expoTokens from users whenever they first open my app in my database table named tokens, I update user’s token with user id later if they decide to sign up or login using their credentials.
I have seen a couple of scenarios please read carefully and please let me know when to delete a token from the database:
user reinstalls app on android, new token generates (I would like to delete old token because sending notification to that old token returns error from FCM and the cause is developer, so this one is clear)
user reinstall app on iOS, new token generates (Sending notification to old token generates no error, status comes back ok, but of course notification doesn’t deliver to old token it delivers to new token though)
user resets Android phone (I tested with factory reset on Samsung), new token generates (Sending notification to old token generates no error, status comes back ok)
didn’t test reseting iPhone
I want to delete expired old useless tokens from the database for obvious reasons, please help me figuring out when to delete those tokens, only case where i could get an error from FCM that is clear that I can delete those tokens from database.
Thanks & Regards, please ask if any questions.