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"]];