From 2f337ad62bcd48284223e15bcb580689cc2c0ecb Mon Sep 17 00:00:00 2001 From: Axel Ogereau-Peltier <49279289+axel-op@users.noreply.github.com> Date: Tue, 14 Apr 2020 13:42:06 +0200 Subject: [PATCH] Use recordExceptionModel instead of recordError --- .../darwin/Classes/FirebaseCrashlyticsPlugin.m | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m b/packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m index eabb5e5ff51b..7063dceb0ec6 100644 --- a/packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m +++ b/packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m @@ -81,16 +81,14 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result if (context != nil) { reason = [NSString stringWithFormat:@"thrown %@", context]; } - NSDictionary *stack = @{ - @"stackTrace" : frames - }; - NSException *exception = [NSException - exceptionWithName:call.arguments[@"exception"] - reason:reason - userInfo:stack]; + FIRExceptionModel *exception = [FIRExceptionModel + exceptionModelWithName:call.arguments[@"exception"] + reason:reason]; + + exception.setStackTrace = frames; - [[FIRCrashlytics crashlytics] recordError:exception]; + [[FIRCrashlytics crashlytics] recordExceptionModel:exception]; result(@"Error reported to Crashlytics."); } else if ([@"Crashlytics#setUserIdentifier" isEqualToString:call.method]) { [[FIRCrashlytics crashlytics] setUserID:call.arguments[@"identifier"]];