3

We have a Xamarin.Android application for a client which is experiencing crashes on the field. They aren't reproducible when going through testing but we are able to handle the crash and add information like the user data to it. But when a crash that isn't handled happens, we just get an obscure log. I've been asked to try and get some user data into the unhandled crash to understand which user has caused it.

So, basically, am I able to add data to the log of an unhandled crash using AppCenters Library?

I've done some research and just found...

AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
{
    TraceWriter.WriteTrace(args.Exception);
    args.Handled = true;
};

This seems to be an overall exception handler. I read it would be just used to get more info about the crash but can't handle it there as the Delvik machine on the device is already crashing. Is this something I could use to pass in more data to a crash?

SmiffyKmc
  • 801
  • 1
  • 16
  • 34

1 Answers1

4

You can add one binary and one text file to the crash report using Crashes.GetErrorAttachments. The file must be smaller than 7MB. There is more information available in the AppCenter Crashes documentation.

You can also set the user id in the AppCenter SDK using AppCenter.SetUserId so you can tell which user generated the crash report.

Trevor Balcom
  • 3,766
  • 2
  • 32
  • 51