Skip to content

Remove manual geo handling in iOS after sentry-cocoa adds geo support in initWithDictionary: #6266

@antonis

Description

@antonis

Description

Once getsentry/sentry-cocoa#8026 is released, SentryUser.initWithDictionary: will natively handle the "geo" key by deserializing it into SentryGeo. This means we can remove the manual geo handling in RNSentry.mm.

Changes needed

In packages/core/ios/RNSentry.mm (userFrom:otherUserKeys:):

  • Remove [filteredKeys removeObjectForKey:@"geo"] and the filteredKeys mutable copy — pass userKeys directly to initWithDictionary:
  • Remove the entire manual geo block (~20 lines: SentryGeo alloc, manual city/countryCode/region parsing, setGeo:)
  • Remove #import <Sentry/SentryGeo.h>

The method should simplify to:

SentryUser *userInstance = [[SentryUser alloc] initWithDictionary:userKeys];
if ([userDataKeys isKindOfClass:NSDictionary.class]) {
    [userInstance setData:userDataKeys];
}
return userInstance;

Prerequisite

Related

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions