joshdholtz / Sentry-Android

[Deprecated] Use official "raven-java" library
https://github.com/getsentry/sentry-java
MIT License
180 stars 48 forks source link

Attach User context #108

Closed fab1an closed 7 years ago

fab1an commented 7 years ago

Is there a way to attach user context like described here: https://docs.sentry.io/learn/context/#capturing-the-user

marcomorain commented 7 years ago

Hi Fabian,

You can use a SentryEventCaptureListener as described in the README to add extra info to an event. The user fields should be accessible on the event in the callback.

marcomorain commented 7 years ago

Oops - hit reply and close on my phone by accident.

marcomorain commented 7 years ago

Yup, in the beforeCapture callback you can call .setUser on the event builder to add user context.

marcomorain commented 7 years ago

Did you get this working @fab1an ?

fab1an commented 7 years ago

Didn't have time for testing yet, i'll report back.

marcomorain commented 7 years ago

Thanks @fab1an