Sentry-dart: User data missing in native crash report

Created on 28 Feb 2021  路  3Comments  路  Source: getsentry/sentry-dart

Thank you for providing sentry_flutter!

I'm using sentry_flutter 4.0.4

I want to get the user data of the app side in the native crash report.
Now, I have written the following code, but it does not work.

Future<void> initializeSentryService() async {
    SentryEvent beforeSend(SentryEvent event, {dynamic hint}) {
      return event.copyWith(user: User(username: 'test user', id: 'test id'));
    }

    await SentryFlutter.init(
      (SentryFlutterOptions options) => options
        ..dsn = 'https://XXXXX'
        ..beforeSend = beforeSend,
    );
  }

For errors on the flutter side, I can get following user data.
User(username: 'test user', id: 'test id')

However, in the case of a native crash, I will not get them.
Is there any way to make it work well for me?

Thank you!

Most helpful comment

@ueman
Sorry, I didn't check #194.

Thank you for your answer.
I hope that feature will be added!

All 3 comments

This is because https://github.com/getsentry/sentry-dart/issues/194 is still missing.

@ueman
Sorry, I didn't check #194.

Thank you for your answer.
I hope that feature will be added!

I'll close it as a dup, thanks.

Was this page helpful?
0 / 5 - 0 ratings