Firebase-ios-sdk: FR: Allow passing nil to Crashlytics.setUserID to match Firebase Analytics and old Fabric Crashlytics APIs

Created on 11 Jun 2020  路  4Comments  路  Source: firebase/firebase-ios-sdk

Feature proposal

  • Firebase Component: Crashlytics

Both Firebase and Fabric Crashlytics allow passing nil to clear the user identifier. It would be nice if Firebase Crashlytics allowed this as well, especially now that it's the recommended replacement for Fabric Crashlytics.

If this change was made, I'd expect to be able to clear a previously assigned user ID by calling:

Firebase.Crashlytics.crashlytics().setUserID(nil)
crashlytics feature request

Most helpful comment

After reading the online documentation (as opposed to the comments in the headers) for the new Firebase Crashlytics library, I found the following:

If you ever need to clear a user identifier after you set it, reset the value to a blank string.

I was primarily concerned about being able to clear the identifier in an officially documented manner, so that fulfills my needs. You can keep this issue open if you want the library to be consistent with the other Firebase libraries, but I'm fine with the issues being closed otherwise.

All 4 comments

Thanks for your feature request and feedback!

I've logged this in our internal trackers that we look at to guide future work, and made a note to bring it up with the team.

After reading the online documentation (as opposed to the comments in the headers) for the new Firebase Crashlytics library, I found the following:

If you ever need to clear a user identifier after you set it, reset the value to a blank string.

I was primarily concerned about being able to clear the identifier in an officially documented manner, so that fulfills my needs. You can keep this issue open if you want the library to be consistent with the other Firebase libraries, but I'm fine with the issues being closed otherwise.

Related to https://github.com/firebase/firebase-android-sdk/issues/1512.

Thanks @rpendleton - that's the right advice (pass an empty string). We're going to stick with this behavior for now.

As for me, it would be nice to have a method like clearUserId() - in this case there will be no need to pass an empty string

Was this page helpful?
0 / 5 - 0 ratings