Visput Visput - 6 months ago 36
iOS Question

Crashlytics: How to see user name/email/id in crash details?

I am using Crashlytics for collecting crashes from iOS app.
To make crash more specific I want to see user name/email/id in crash details.

For this goal I use such code:

[Crashlytics setUserIdentifier:@"userID"];
[Crashlytics setUserEmail:@"user@email.com"];
[Crashlytics setUserName:@"userName"];


When crash happens I cannot find a way to see this information in crash details.

I see such screen:

enter image description here

Question: How can I see user name/email/id in crash details?

Answer

This is how I am doing it

Crashlytics.sharedInstance.userIdentifier = (user) ? user : @"Unknown";
Crashlytics.sharedInstance.userName = (firstName && lastName) ? [NSString stringWithFormat: @"%@ %@", firstName, lastName] : @"Anonymous";

I am doing it once when the user data is available. Shows up in Fabric like this (when viewing details for a single crash): enter image description here