From 371f791a6ddc856e01c683ef7a5f01ae03fd9647 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Thu, 1 Aug 2024 15:49:24 +0100 Subject: [PATCH] feat: :sparkles: handle correlation property in ios events --- .../ios/BugsnagReactNative/BugsnagEventDeserializer.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ios/BugsnagReactNative/BugsnagEventDeserializer.m b/packages/react-native/ios/BugsnagReactNative/BugsnagEventDeserializer.m index 280a788672..b781b7e87c 100644 --- a/packages/react-native/ios/BugsnagReactNative/BugsnagEventDeserializer.m +++ b/packages/react-native/ios/BugsnagReactNative/BugsnagEventDeserializer.m @@ -17,6 +17,7 @@ - (BugsnagEvent *)deserializeEvent:(NSDictionary *)payload { BugsnagHandledState *handledState = [self deserializeHandledState:payload]; NSDictionary *user = payload[@"user"]; + NSDictionary *correlation = payload[@"correlation"]; BugsnagEvent *event = [[BugsnagEvent alloc] initWithApp:[BugsnagAppWithState appFromJson:payload[@"app"]] device:[BugsnagDeviceWithState deviceFromJson:payload[@"device"]] @@ -30,6 +31,8 @@ - (BugsnagEvent *)deserializeEvent:(NSDictionary *)payload { event.context = payload[@"context"]; event.groupingHash = payload[@"groupingHash"]; + [event setCorrelationTraceId:correlation[@"traceId"] spanId:correlation[@"spanId"]]; + if (payload[@"apiKey"]) { event.apiKey = payload[@"apiKey"]; }