2

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?

  • Have you checked this? – Piyush Dec 11 at 13:19
  • I did but didnt provide any userful info. In one of my classes where I am pulling the profile. I am setting the username/identifier etc for crashlytics. Upon logout how do I clean out these values or data? – Marissa Nicholas Dec 12 at 16:05
  • I updated my question in the hopes it will give clearer explanation – Marissa Nicholas Dec 12 at 20:53
  • I think this CrashlyticsCore.getInstance().setUserIdentifier(null) should be worked. – Piyush Dec 13 at 5:21
  • should i also clearout logexception or thats not necessary? CrashlyticsCore.getInstance.logexception(null) – Marissa Nicholas Dec 13 at 12:04
1
+50

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.

  • empty strings as in CrashlyticsCore.getInstance().setUserEmail(String.EMPTY)? or null will suffice – Marissa Nicholas Dec 13 at 18:53
  • Reading the description I understand CrashlyticsCore.getInstance().setUserEmail("") – gicci Dec 13 at 18:56

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.