Skip to content

Commit d013700

Browse files
authored
fix: Return success during Cocoa SDK init on macOS (#2104)
* return success state * Updated CHANGELOG.md
1 parent 5a7119f commit d013700

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- When targeting macOS, the SDK no longer fails to sync the scope to native events ([#2104](https://github.com/getsentry/sentry-unity/pull/2104))
8+
59
### Features
610

711
- When running on Android, Windows or Linux, the SDK now links errors and events originating on different layers (managed, native errors) via `trace ID` ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089))

package-dev/Plugins/macOS/SentryNativeBridge.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,22 @@ void SentryNativeBridgeOptionsSetInt(const void *options, const char *name, int3
7272
dictOptions[[NSString stringWithUTF8String:name]] = [NSNumber numberWithInt:value];
7373
}
7474

75-
void SentryNativeBridgeStartWithOptions(const void *options)
75+
int SentryNativeBridgeStartWithOptions(const void *options)
7676
{
7777
NSMutableDictionary *dictOptions = (__bridge_transfer NSMutableDictionary *)options;
78+
NSError *error = nil;
79+
7880
id sentryOptions = [[SentryOptions alloc]
7981
performSelector:@selector(initWithDict:didFailWithError:)
80-
withObject:dictOptions withObject:nil];
82+
withObject:dictOptions withObject:&error];
83+
84+
if (error != nil)
85+
{
86+
return 0;
87+
}
8188

8289
[SentrySDK performSelector:@selector(startWithOptions:) withObject:sentryOptions];
90+
return 1;
8391
}
8492

8593
void SentryConfigureScope(void (^callback)(id))

0 commit comments

Comments
 (0)