I am using fabric/crashlytics for log reporting. I am usually setting username, email,id etc once a user signs into my app. I was wondering if there is a way I can clear out my user data on app signout. I tried looking for a way /function to clear data on crashlytics but no luck. Any ideas?
Currently I am setting username, email etc on my user profile page once a user signs in:
CrashlyticsCore.getInstance().setUserEmail(it.email)
CrashlyticsCore.getInstance().setUserName(it.firstName)
CrashlyticsCore.getInstance().setUserIdentifier(it.username)
and also once the app is launched I set this in my "application" class :
Fabric.with(this, CrashlyticsCore())
I want to keep the crashlytics running for the app but the user specific data cleared out upon logout. do I simply set it to null such that?
CrashlyticsCore.getInstance().setUserIdentifier(null) etc.,
or is there some clearuser data param I can use in my logout function?
You should refer to the Firebase documentation for Crashlytics, as it is currently merged with Google's Firebase while the SDK has been left unchanged. This specific functionality is documented here.
If you ever need to clear a user identifier after you set it, reset the value to a blank string. Clearing a user identifier does not remove existing Crashlytics records. If you need to delete records associated with a user ID, contact Firebase support.
So you shall set the user identifiers to the empty string, to avoid new crash reports to contain the previously logged user data. Existing ones cannot be modified.