コード例 #1
0
        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;
        }
コード例 #2
0
 public void RecordException(System.Exception exception)
 {
     Firebase.Crashlytics.FirebaseCrashlytics.Instance.RecordException(CrashlyticsException.Create(exception));
 }