1

I set the user id value as below code. (flutter) in ios section Crashlytics dashboard alway show user id but why android section show user id only sometime. Is there a way to make it alway show?

Future<void> handleError(Object error, StackTrace? stack) async {
  if (!error.toString().contains('Invalid argument(s)') &&
      !error.toString().contains('Invalid statusCode')) {
    final userSession = Modular.get<UserSession>();
    if (userSession.userId != null) {
      await FirebaseCrashlytics.instance.setUserIdentifier(userSession.userId!);
    }
    await FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
    Modular.get<ErrorBloc>().add(const ShowError());
  }
}

1. image for Crashlytics dashboard show user id

2.image for Crashlytics dashboard not show user id

1 Answers1

0

This scenario can happen if the crash happened before calling "setUserIdentifier".

In the code snippet you are calling this method only if the userId is not null. There can be early crashes that happen before the user is authenticated.

Gerardo
  • 3,460
  • 1
  • 16
  • 18