public void HandleUncaughtException(bool shouldThrowFormattedException = true) { if (_handler != null) { AndroidEnvironment.UnhandledExceptionRaiser -= _handler; } _handler = (s, e) => { if (shouldThrowFormattedException && Thread.DefaultUncaughtExceptionHandler != null) { Thread.DefaultUncaughtExceptionHandler.UncaughtException(Thread.CurrentThread(), CrashlyticsException.Create(e.Exception)); } else { RecordException(e.Exception); } }; AndroidEnvironment.UnhandledExceptionRaiser += _handler; }
public void RecordException(System.Exception exception) { Firebase.Crashlytics.FirebaseCrashlytics.Instance.RecordException(CrashlyticsException.Create(exception)); }