Log out the user on a fresh install
To do this, you should keep a flag in your app’s storage, one that you can check to see if the app has been reinstalled, and set it on first launch. First, install the@react-native-async-storage/async-storage
package, as a way to store the flag in your app’s storage in a way that it does not persist across app reinstalls.
My app is already in production
If your application is already deployed in production, note that this will also log out every user the first time they launch after this update, as if it were a fresh install. This can be circumvented by doing an intermediate release first, that includes thesetItem
logic only, but not the logout
call yet.