Roy Solberg
Roy Solberg

Reputation: 19723

What is the best way to set a Firebase Crash user identifier in a widget?

I have been using Crashlytics quite a lot, but now I'm trying out Firebase Crash in an app.

I would like to set some kind of user identifier to be able to cross check reports sent by users themselves and crash reports.

In Crashlytics I have always used Crashlytics.setUserIdentifier() (https://docs.fabric.io/android/crashlytics/enhanced-reports.html?identifier#user-information ).

As far as I can see I have to use FirebaseCrash.log() (https://firebase.google.com/docs/crash/android#create_custom_logs ), but that won't set the identifier one time, right? I suppose it will log it every time I call that method.

That leads me to the real question. The app is a widget with a service that runs relatively often without the user needing to access an activity. What will be the best place to do that logging?

Using Crashlytics I have set the user identifier either in the main activity or in a class extending Application. Doing the last of the two with Firebase Crash seems to trigger a known issue.

Upvotes: 0

Views: 1158

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317760

Currently there is no way to uniquely identify a user in a crash report. We are considering ways to be able to do this without compromising the privacy of the individual user, which is very important to us.

Upvotes: 1

Related Questions