diff --git a/CHANGELOG.md b/CHANGELOG.md index 3733d9728..c139bb513 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixes + +- When targeting macOS, the SDK no longer fails to sync the scope to native events ([#2104](https://github.com/getsentry/sentry-unity/pull/2104)) + ### Features - The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083)) diff --git a/package-dev/Plugins/macOS/SentryNativeBridge.m b/package-dev/Plugins/macOS/SentryNativeBridge.m index 0f696675d..9deca8dae 100644 --- a/package-dev/Plugins/macOS/SentryNativeBridge.m +++ b/package-dev/Plugins/macOS/SentryNativeBridge.m @@ -72,14 +72,22 @@ void SentryNativeBridgeOptionsSetInt(const void *options, const char *name, int3 dictOptions[[NSString stringWithUTF8String:name]] = [NSNumber numberWithInt:value]; } -void SentryNativeBridgeStartWithOptions(const void *options) +int SentryNativeBridgeStartWithOptions(const void *options) { NSMutableDictionary *dictOptions = (__bridge_transfer NSMutableDictionary *)options; + NSError *error = nil; + id sentryOptions = [[SentryOptions alloc] performSelector:@selector(initWithDict:didFailWithError:) - withObject:dictOptions withObject:nil]; + withObject:dictOptions withObject:&error]; + + if (error != nil) + { + return 0; + } [SentrySDK performSelector:@selector(startWithOptions:) withObject:sentryOptions]; + return 1; } void SentryConfigureScope(void (^callback)(id))