How to set user information to Crashlytics api in Android

情到浓时终转凉″ 提交于 2019-12-10 04:35:36

问题


I am trying to set user information to crash reports in crashlytics in Android App, so that it will help me to find out which of our users experienced a given crash. I have explored and found there are 3 APIs can set user information in crash report.

Those are,

void Crashlytics.setUserIdentifier(String identifier);

void Crashlytics.setUserName(String name);

void Crashlytics.setUserEmail(String email);

It is recommended to use all the APIs. All documented at http://support.crashlytics.com/knowledgebase/articles/120548-how-do-i-set-user-information-

But I have no idea, 1. How to get user-identifier, name and email details, which are input to those APIs? 2. Which place in program to call these crashlytics APIs?

Please share some ideas, how to implement this.

Regards

Annada


回答1:


If your application uses some form of user identification (i.e. login, email, phone, device specific id) you can use that as crashlitics user information. I suppose you can generate user id when your app is first launched and save it in shared preferences, for example. It'll be shown at top-right corner of detailed crash view.

i.e. I set ID and name as soon as user authenticates in my app.

You typically want to set them as soon as possible (as your data arrives) and all info has been initialized.




回答2:



Looks like detail UI in Fabric has been changed.

  1. Select one of crash issue.
  2. Click Version in Recently Activity

  3. On detail page top right hand corner, you should see affected user information.



来源:https://stackoverflow.com/questions/36197789/how-to-set-user-information-to-crashlytics-api-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!