From 219f738e2d59102cff7d9693298cd768c46b0465 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 1 Sep 2025 11:40:51 +0200 Subject: [PATCH 01/10] WIP: build(deps): bump sentry-cocoa from 8.53.2 to 8.54.0 --- modules/sentry-cocoa.properties | 2 +- scripts/generate-cocoa-bindings.ps1 | 14 +- src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 232 +----------------- .../SwiftApiDefinitions.cs | 221 +++++++++++++++++ 4 files changed, 241 insertions(+), 228 deletions(-) diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index f3c920b1e0..c1fb9cce1e 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.53.2 +version = 8.54.0 repo = https://github.com/getsentry/sentry-cocoa diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index d06ebea472..6776309942 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -49,14 +49,14 @@ if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/ # Verify checksum Write-Output "Verifying package checksum..." $actualSha256 = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash.ToLower() - + if ($actualSha256 -ne $expectedSha256) { Write-Error "Checksum verification failed. Expected: $expectedSha256, Actual: $actualSha256" Remove-Item $downloadPath -Force -ErrorAction SilentlyContinue exit 1 } - + Write-Output "Checksum verification passed." if (Test-Path $downloadPath) @@ -108,7 +108,7 @@ foreach ($file in $filesToPatch) { $content = Get-Content -Path $file -Raw $content = $content -replace ']+)>', '"$1"' - $content = $content -replace '#import SENTRY_HEADER\(([^)]+)\)', '#import "$1.h"' + $content = $content -replace '#\s*import SENTRY_HEADER\(([^)]+)\)', '#import "$1.h"' Set-Content -Path $file -Value $content } else @@ -209,7 +209,10 @@ $Text = $Text -replace '\bISentrySerializable\b', 'SentrySerializable' $Text = $Text -replace ': INSCopying,', ':' -replace '\s?[:,] INSCopying', '' # Remove iOS attributes like [iOS (13, 0)] -$Text = $Text -replace '\[iOS \(13,\s?0\)\]\n?', '' +$Text = $Text -replace '\[iOS \(13,\s?0\)\]\n?\s*', '' + +# Remove Unavailable attributes like [Unavailable (PlatformName.iOSAppExtension)] +$Text = $Text -replace '\[Unavailable \(PlatformName\.\w+\)\]\n?\s*', '' # Fix delegate argument names $Text = $Text -replace '(NSError) arg\d', '$1 error' @@ -259,8 +262,9 @@ $Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+) \{ get; \}', '$ # We have some that accept either NSString or NSRegularExpression, which have no common type so they use NSObject $Text = $Text -replace '\s*\[Verify \(StronglyTypedNSArray\)\]\n', '' -# Fix broken line comment +# Fix broken multi-line comments $Text = $Text -replace '(DEPRECATED_MSG_ATTRIBUTE\()\n\s*', '$1' +$Text = $Text -replace '(DEPRECATED_MSG_ATTRIBUTE\([^)]*?)"\s*\r?\n\s*"', '$1 ' # Remove default IsEqual implementation (already implemented by NSObject) $Text = $Text -replace '(?ms)\n?^ *// [^\n]*isEqual:.*?$.*?;\n', '' diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 3b563d3c4f..9c90c08c8b 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -612,11 +612,11 @@ interface SentryException : SentrySerializable interface SentryFeedbackAPI { // -(void)showWidget __attribute__((availability(ios, introduced=13.0))); - [Export ("showWidget")] + [Export ("showWidget")] void ShowWidget (); // -(void)hideWidget __attribute__((availability(ios, introduced=13.0))); - [Export ("hideWidget")] + [Export ("hideWidget")] void HideWidget (); } @@ -1562,19 +1562,19 @@ interface SentryOptions [NullAllowed, Export ("configureProfiling", ArgumentSemantic.Copy)] SentryProfilingConfigurationBlock ConfigureProfiling { get; set; } - // @property (assign, nonatomic) BOOL enableAppLaunchProfiling; + // @property (assign, nonatomic) BOOL enableAppLaunchProfiling __attribute__((deprecated("This property is deprecated and will be removed in a future version of the SDK. See SentryProfileOptions.startOnAppStart and SentryProfileOptions.lifecycle"))); [Export ("enableAppLaunchProfiling")] bool EnableAppLaunchProfiling { get; set; } - // @property (nonatomic, strong) NSNumber * _Nullable profilesSampleRate; - [NullAllowed, Export ("profilesSampleRate", ArgumentSemantic.Strong)] + // @property (nonatomic, strong) DEPRECATED_MSG_ATTRIBUTE("This property is deprecated and will be removed in a future version of the SDK. See SentryProfileOptions.sessionSampleRate") NSNumber * profilesSampleRate __attribute__((deprecated("This property is deprecated and will be removed in a future version of the SDK. See SentryProfileOptions.sessionSampleRate"))); + [Export ("profilesSampleRate", ArgumentSemantic.Strong)] NSNumber ProfilesSampleRate { get; set; } - // @property (nonatomic) SentryTracesSamplerCallback _Nullable profilesSampler; - [NullAllowed, Export ("profilesSampler", ArgumentSemantic.Assign)] + // @property (nonatomic) DEPRECATED_MSG_ATTRIBUTE("This property is deprecated and will be removed in a future version of the SDK. See SentryProfileOptions.sessionSampleRate") SentryTracesSamplerCallback profilesSampler __attribute__((deprecated("This property is deprecated and will be removed in a future version of the SDK. See SentryProfileOptions.sessionSampleRate"))); + [Export ("profilesSampler", ArgumentSemantic.Assign)] SentryTracesSamplerCallback ProfilesSampler { get; set; } - // @property (readonly, assign, nonatomic) BOOL isProfilingEnabled; + // @property (readonly, assign, nonatomic) BOOL isProfilingEnabled __attribute__((deprecated("This property is deprecated and will be removed in a future version of the SDK"))); [Export ("isProfilingEnabled")] bool IsProfilingEnabled { get; } @@ -1649,8 +1649,8 @@ interface SentryOptions [Export ("_swiftExperimentalOptions")] NSObject _swiftExperimentalOptions { get; } - // @property (copy, nonatomic) API_AVAILABLE(ios(13.0)) SentryUserFeedbackConfigurationBlock configureUserFeedback __attribute__((availability(ios, introduced=13.0))); - [Export ("configureUserFeedback", ArgumentSemantic.Copy)] + // @property (copy, nonatomic) API_AVAILABLE(ios(13.0)) SentryUserFeedbackConfigurationBlock configureUserFeedback __attribute__((availability(ios, introduced=13.0))) __attribute__((availability(macos_app_extension, unavailable))) __attribute__((availability(ios_app_extension, unavailable))); + [Export ("configureUserFeedback", ArgumentSemantic.Copy)] SentryUserFeedbackConfigurationBlock ConfigureUserFeedback { get; set; } } @@ -1734,218 +1734,6 @@ interface SentryRequest : SentrySerializable string Url { get; set; } } -// @interface SentrySDK : NSObject -[BaseType (typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentrySDK -{ - // @property (readonly, nonatomic, class) id _Nullable span; - [Static] - [NullAllowed, Export ("span")] - SentrySpan Span { get; } - - // @property (readonly, nonatomic, class) BOOL isEnabled; - [Static] - [Export ("isEnabled")] - bool IsEnabled { get; } - - // @property (readonly, nonatomic, class) SentryReplayApi * _Nonnull replay; - [Static] - [Export ("replay")] - SentryReplayApi Replay { get; } - - // +(void)startWithOptions:(SentryOptions * _Nonnull)options __attribute__((swift_name("start(options:)"))); - [Static] - [Export ("startWithOptions:")] - void StartWithOptions (SentryOptions options); - - // +(void)startWithConfigureOptions:(void (^ _Nonnull)(SentryOptions * _Nonnull))configureOptions __attribute__((swift_name("start(configureOptions:)"))); - [Static] - [Export ("startWithConfigureOptions:")] - void StartWithConfigureOptions (Action configureOptions); - - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event __attribute__((swift_name("capture(event:)"))); - [Static] - [Export ("captureEvent:")] - SentryId CaptureEvent (SentryEvent @event); - - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope __attribute__((swift_name("capture(event:scope:)"))); - [Static] - [Export ("captureEvent:withScope:")] - SentryId CaptureEvent (SentryEvent @event, SentryScope scope); - - // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block __attribute__((swift_name("capture(event:block:)"))); - [Static] - [Export ("captureEvent:withScopeBlock:")] - SentryId CaptureEvent (SentryEvent @event, Action block); - - // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation __attribute__((swift_name("startTransaction(name:operation:)"))); - [Static] - [Export ("startTransactionWithName:operation:")] - SentrySpan StartTransactionWithName (string name, string operation); - - // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope __attribute__((swift_name("startTransaction(name:operation:bindToScope:)"))); - [Static] - [Export ("startTransactionWithName:operation:bindToScope:")] - SentrySpan StartTransactionWithName (string name, string operation, bool bindToScope); - - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext __attribute__((swift_name("startTransaction(transactionContext:)"))); - [Static] - [Export ("startTransactionWithContext:")] - SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext); - - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope __attribute__((swift_name("startTransaction(transactionContext:bindToScope:)"))); - [Static] - [Export ("startTransactionWithContext:bindToScope:")] - SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, bool bindToScope); - - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext __attribute__((swift_name("startTransaction(transactionContext:bindToScope:customSamplingContext:)"))); - [Static] - [Export ("startTransactionWithContext:bindToScope:customSamplingContext:")] - SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); - - // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext __attribute__((swift_name("startTransaction(transactionContext:customSamplingContext:)"))); - [Static] - [Export ("startTransactionWithContext:customSamplingContext:")] - SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, NSDictionary customSamplingContext); - - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error __attribute__((swift_name("capture(error:)"))); - [Static] - [Export ("captureError:")] - SentryId CaptureError (NSError error); - - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope __attribute__((swift_name("capture(error:scope:)"))); - [Static] - [Export ("captureError:withScope:")] - SentryId CaptureError (NSError error, SentryScope scope); - - // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block __attribute__((swift_name("capture(error:block:)"))); - [Static] - [Export ("captureError:withScopeBlock:")] - SentryId CaptureError (NSError error, Action block); - - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception __attribute__((swift_name("capture(exception:)"))); - [Static] - [Export ("captureException:")] - SentryId CaptureException (NSException exception); - - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope __attribute__((swift_name("capture(exception:scope:)"))); - [Static] - [Export ("captureException:withScope:")] - SentryId CaptureException (NSException exception, SentryScope scope); - - // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block __attribute__((swift_name("capture(exception:block:)"))); - [Static] - [Export ("captureException:withScopeBlock:")] - SentryId CaptureException (NSException exception, Action block); - - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message __attribute__((swift_name("capture(message:)"))); - [Static] - [Export ("captureMessage:")] - SentryId CaptureMessage (string message); - - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope __attribute__((swift_name("capture(message:scope:)"))); - [Static] - [Export ("captureMessage:withScope:")] - SentryId CaptureMessage (string message, SentryScope scope); - - // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block __attribute__((swift_name("capture(message:block:)"))); - [Static] - [Export ("captureMessage:withScopeBlock:")] - SentryId CaptureMessage (string message, Action block); - - // +(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))) __attribute__((deprecated("Use SentrySDK.captureFeedback or use or configure our new managed UX with SentryOptions.configureUserFeedback."))); - [Static] - [Export ("captureUserFeedback:")] - void CaptureUserFeedback (SentryUserFeedback userFeedback); - - // +(void)captureFeedback:(SentryFeedback * _Nonnull)feedback __attribute__((swift_name("capture(feedback:)"))); - [Static] - [Export ("captureFeedback:")] - void CaptureFeedback (SentryFeedback feedback); - - // @property (readonly, nonatomic, class) API_AVAILABLE(ios(13.0)) SentryFeedbackAPI * feedback __attribute__((availability(ios, introduced=13.0))); - [Static] - [Export ("feedback")] - SentryFeedbackAPI Feedback { get; } - - // +(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb __attribute__((swift_name("addBreadcrumb(_:)"))); - [Static] - [Export ("addBreadcrumb:")] - void AddBreadcrumb (SentryBreadcrumb crumb); - - // +(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; - [Static] - [Export ("configureScope:")] - void ConfigureScope (Action callback); - - // @property (readonly, nonatomic, class) BOOL crashedLastRun; - [Static] - [Export ("crashedLastRun")] - bool CrashedLastRun { get; } - - // @property (readonly, nonatomic, class) BOOL detectedStartUpCrash; - [Static] - [Export ("detectedStartUpCrash")] - bool DetectedStartUpCrash { get; } - - // +(void)setUser:(SentryUser * _Nullable)user; - [Static] - [Export ("setUser:")] - void SetUser ([NullAllowed] SentryUser user); - - // +(void)startSession; - [Static] - [Export ("startSession")] - void StartSession (); - - // +(void)endSession; - [Static] - [Export ("endSession")] - void EndSession (); - - // +(void)crash; - [Static] - [Export ("crash")] - void Crash (); - - // +(void)reportFullyDisplayed; - [Static] - [Export ("reportFullyDisplayed")] - void ReportFullyDisplayed (); - - // +(void)pauseAppHangTracking; - [Static] - [Export ("pauseAppHangTracking")] - void PauseAppHangTracking (); - - // +(void)resumeAppHangTracking; - [Static] - [Export ("resumeAppHangTracking")] - void ResumeAppHangTracking (); - - // +(void)flush:(NSTimeInterval)timeout __attribute__((swift_name("flush(timeout:)"))); - [Static] - [Export ("flush:")] - void Flush (double timeout); - - // +(void)close; - [Static] - [Export ("close")] - void Close (); - - // +(void)startProfiler; - [Static] - [Export ("startProfiler")] - void StartProfiler (); - - // +(void)stopProfiler; - [Static] - [Export ("stopProfiler")] - void StopProfiler (); -} - // @interface SentrySamplingContext : NSObject [BaseType (typeof(NSObject))] [Internal] diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs index 77c2373975..14abe68d90 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs @@ -248,6 +248,227 @@ interface SentryRRWebEvent : SentrySerializable new NSDictionary Serialize(); } +// @interface SentrySDK : NSObject +[BaseType(typeof(NSObject), Name = "_TtC6Sentry9SentrySDK")] +[DisableDefaultCtor] +[Internal] +interface SentrySDK +{ + // @property (nonatomic, class, readonly, strong) id _Nullable span; + [Static] + [NullAllowed, Export("span")] + SentrySpan Span { get; } + + // @property (nonatomic, class, readonly) BOOL isEnabled; + [Static] + [Export("isEnabled")] + bool IsEnabled { get; } + + // @property (nonatomic, class, readonly, strong) SentryReplayApi * _Nonnull replay; + [Static] + [Export("replay")] + SentryReplayApi Replay { get; } + + // @property (nonatomic, class, readonly, strong) SentryLogger * _Nonnull logger; + + // + (void)startWithOptions:(SentryOptions * _Nonnull)options; + [Static] + [Export("startWithOptions:")] + void StartWithOptions(SentryOptions options); + + // + (void)startWithConfigureOptions:(void (^ _Nonnull)(SentryOptions * _Nonnull))configureOptions; + [Static] + [Export("startWithConfigureOptions:")] + void StartWithConfigureOptions(Action configureOptions); + + // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; + [Static] + [Export("captureEvent:")] + SentryId CaptureEvent(SentryEvent @event); + + // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; + [Static] + [Export("captureEvent:withScope:")] + SentryId CaptureEvent(SentryEvent @event, SentryScope scope); + + // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + [Static] + [Export("captureEvent:withScopeBlock:")] + SentryId CaptureEvent(SentryEvent @event, Action block); + + // + (id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; + [Static] + [Export("startTransactionWithName:operation:")] + SentrySpan StartTransactionWithName(string name, string operation); + + // + (id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope; + [Static] + [Export("startTransactionWithName:operation:bindToScope:")] + SentrySpan StartTransactionWithName(string name, string operation, bool bindToScope); + + // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext; + [Static] + [Export("startTransactionWithContext:")] + SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext); + + // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope; + [Static] + [Export("startTransactionWithContext:bindToScope:")] + SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope); + + // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; + [Static] + [Export("startTransactionWithContext:bindToScope:customSamplingContext:")] + SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); + + // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; + [Static] + [Export ("startTransactionWithContext:customSamplingContext:")] + SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, NSDictionary customSamplingContext); + + // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; + [Static] + [Export ("captureError:")] + SentryId CaptureError (NSError error); + + // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; + [Static] + [Export ("captureError:withScope:")] + SentryId CaptureError (NSError error, SentryScope scope); + + // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + [Static] + [Export ("captureError:withScopeBlock:")] + SentryId CaptureError (NSError error, Action block); + + // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; + [Static] + [Export ("captureException:")] + SentryId CaptureException (NSException exception); + + // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; + [Static] + [Export ("captureException:withScope:")] + SentryId CaptureException (NSException exception, SentryScope scope); + + // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + [Static] + [Export ("captureException:withScopeBlock:")] + SentryId CaptureException (NSException exception, Action block); + + // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; + [Static] + [Export ("captureMessage:")] + SentryId CaptureMessage (string message); + + // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; + [Static] + [Export ("captureMessage:withScope:")] + SentryId CaptureMessage (string message, SentryScope scope); + + // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + [Static] + [Export ("captureMessage:withScopeBlock:")] + SentryId CaptureMessage (string message, Action block); + + // + (void) captureUserFeedback:(SentryUserFeedback* _Nonnull) userFeedback SWIFT_DEPRECATED_MSG("Use SentrySDK.back or use or configure our new managed UX with SentryOptions.configureUserFeedback."); + [Static] + [Export ("captureUserFeedback:")] + void CaptureUserFeedback (SentryUserFeedback userFeedback); + + // + (void)captureFeedback:(SentryFeedback * _Nonnull)feedback; + [Static] + [Export ("captureFeedback:")] + void CaptureFeedback (SentryFeedback feedback); + + // @property (nonatomic, class, readonly, strong) SentryFeedbackAPI * _Nonnull feedback SWIFT_AVAILABILITY(ios,introduced=13.0); + [Static] + [Export ("feedback")] + SentryFeedbackAPI Feedback { get; } + + // + (void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb; + [Static] + [Export ("addBreadcrumb:")] + void AddBreadcrumb (SentryBreadcrumb crumb); + + // + (void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; + [Static] + [Export ("configureScope:")] + void ConfigureScope (Action callback); + + // @property (nonatomic, class, readonly) BOOL crashedLastRun; + [Static] + [Export ("crashedLastRun")] + bool CrashedLastRun { get; } + + // property (nonatomic, class, readonly) BOOL detectedStartUpCrash; + [Static] + [Export ("detectedStartUpCrash")] + bool DetectedStartUpCrash { get; } + + // + (void)setUser:(SentryUser * _Nullable)user; + [Static] + [Export ("setUser:")] + void SetUser ([NullAllowed] SentryUser user); + + // + (void)startSession; + [Static] + [Export ("startSession")] + void StartSession (); + + // + (void)endSession; + [Static] + [Export ("endSession")] + void EndSession (); + + // + (void)crash; + [Static] + [Export ("crash")] + void Crash (); + + // + (void)reportFullyDisplayed; + [Static] + [Export ("reportFullyDisplayed")] + void ReportFullyDisplayed (); + + // + (void)pauseAppHangTracking; + [Static] + [Export ("pauseAppHangTracking")] + void PauseAppHangTracking (); + + // + (void)resumeAppHangTracking; + [Static] + [Export ("resumeAppHangTracking")] + void ResumeAppHangTracking (); + + // + (void)flush:(NSTimeInterval)timeout; + [Static] + [Export ("flush:")] + void Flush (double timeout); + + // + (void)close; + [Static] + [Export ("close")] + void Close (); + + // + (void)startProfiler; + [Static] + [Export ("startProfiler")] + void StartProfiler (); + + // + (void)stopProfiler; + [Static] + [Export ("stopProfiler")] + void StopProfiler (); + + // + (void)clearLogger; + + // - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; + [Export("init")] + [DesignatedInitializer] + IntPtr Constructor(); +} + // @interface SentryUserFeedback : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] From f8fefb75f403c269ed2b3a652616a3375b918dc1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 1 Sep 2025 14:08:15 +0200 Subject: [PATCH 02/10] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b47a5320e..0257b6bcc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ - Bump Native SDK from v0.9.1 to v0.10.0 ([#4436](https://github.com/getsentry/sentry-dotnet/pull/4436)) - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0100) - [diff](https://github.com/getsentry/sentry-native/compare/0.9.1...0.10.0) +- Bump sentry-cocoa from 8.46.0 to 8.54.0 ([#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8540) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.46.2...8.54.0) ## 5.14.1 From 916c95e7a0887c384ad10c25d458f0549ce17635 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 Sep 2025 10:47:44 +0200 Subject: [PATCH 03/10] Sync with generated SentrySdk & SentryLogger From https://github.com/getsentry/sentry-dotnet/pull/4488 --- .../SwiftApiDefinitions.cs | 200 +++++++++++------- 1 file changed, 128 insertions(+), 72 deletions(-) diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs index 14abe68d90..2d7de3da8c 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs @@ -66,6 +66,61 @@ interface SentryId nuint Hash { get; } } +// @interface SentryLogger : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry12SentryLogger")] +[DisableDefaultCtor] +[Internal] +interface SentryLogger +{ + // -(void)trace:(NSString * _Nonnull)body; + [Export ("trace:")] + void Trace (string body); + + // -(void)trace:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("trace:attributes:")] + void Trace (string body, NSDictionary attributes); + + // -(void)debug:(NSString * _Nonnull)body; + [Export ("debug:")] + void Debug (string body); + + // -(void)debug:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("debug:attributes:")] + void Debug (string body, NSDictionary attributes); + + // -(void)info:(NSString * _Nonnull)body; + [Export ("info:")] + void Info (string body); + + // -(void)info:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("info:attributes:")] + void Info (string body, NSDictionary attributes); + + // -(void)warn:(NSString * _Nonnull)body; + [Export ("warn:")] + void Warn (string body); + + // -(void)warn:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("warn:attributes:")] + void Warn (string body, NSDictionary attributes); + + // -(void)error:(NSString * _Nonnull)body; + [Export ("error:")] + void Error (string body); + + // -(void)error:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("error:attributes:")] + void Error (string body, NSDictionary attributes); + + // -(void)fatal:(NSString * _Nonnull)body; + [Export ("fatal:")] + void Fatal (string body); + + // -(void)fatal:(NSString * _Nonnull)body attributes:(NSDictionary * _Nonnull)attributes; + [Export ("fatal:attributes:")] + void Fatal (string body, NSDictionary attributes); +} + // @interface SentryProfileOptions : NSObject [BaseType(typeof(NSObject), Name = "_TtC6Sentry20SentryProfileOptions")] [DisableDefaultCtor] @@ -254,219 +309,220 @@ interface SentryRRWebEvent : SentrySerializable [Internal] interface SentrySDK { - // @property (nonatomic, class, readonly, strong) id _Nullable span; + // @property (readonly, nonatomic, strong, class) id _Nullable span; [Static] - [NullAllowed, Export("span")] + [NullAllowed, Export ("span", ArgumentSemantic.Strong)] SentrySpan Span { get; } - // @property (nonatomic, class, readonly) BOOL isEnabled; + // @property (readonly, nonatomic, class) BOOL isEnabled; [Static] - [Export("isEnabled")] + [Export ("isEnabled")] bool IsEnabled { get; } - // @property (nonatomic, class, readonly, strong) SentryReplayApi * _Nonnull replay; + // @property (readonly, nonatomic, strong, class) SentryReplayApi * _Nonnull replay; [Static] - [Export("replay")] + [Export ("replay", ArgumentSemantic.Strong)] SentryReplayApi Replay { get; } - // @property (nonatomic, class, readonly, strong) SentryLogger * _Nonnull logger; + // @property (readonly, nonatomic, strong, class) SentryLogger * _Nonnull logger; + [Static] + [Export ("logger", ArgumentSemantic.Strong)] + SentryLogger Logger { get; } - // + (void)startWithOptions:(SentryOptions * _Nonnull)options; + // +(void)startWithOptions:(SentryOptions * _Nonnull)options; [Static] - [Export("startWithOptions:")] - void StartWithOptions(SentryOptions options); + [Export ("startWithOptions:")] + void StartWithOptions (SentryOptions options); - // + (void)startWithConfigureOptions:(void (^ _Nonnull)(SentryOptions * _Nonnull))configureOptions; + // +(void)startWithConfigureOptions:(void (^ _Nonnull)(SentryOptions * _Nonnull))configureOptions; [Static] - [Export("startWithConfigureOptions:")] - void StartWithConfigureOptions(Action configureOptions); + [Export ("startWithConfigureOptions:")] + void StartWithConfigureOptions (Action configureOptions); - // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; + // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event; [Static] - [Export("captureEvent:")] - SentryId CaptureEvent(SentryEvent @event); + [Export ("captureEvent:")] + SentryId CaptureEvent (SentryEvent @event); - // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; + // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScope:(SentryScope * _Nonnull)scope; [Static] - [Export("captureEvent:withScope:")] - SentryId CaptureEvent(SentryEvent @event, SentryScope scope); + [Export ("captureEvent:withScope:")] + SentryId CaptureEvent (SentryEvent @event, SentryScope scope); - // + (SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + // +(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; [Static] - [Export("captureEvent:withScopeBlock:")] - SentryId CaptureEvent(SentryEvent @event, Action block); + [Export ("captureEvent:withScopeBlock:")] + SentryId CaptureEvent (SentryEvent @event, Action block); - // + (id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; + // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation; [Static] - [Export("startTransactionWithName:operation:")] - SentrySpan StartTransactionWithName(string name, string operation); + [Export ("startTransactionWithName:operation:")] + SentrySpan StartTransactionWithName (string name, string operation); - // + (id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope; + // +(id _Nonnull)startTransactionWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation bindToScope:(BOOL)bindToScope; [Static] - [Export("startTransactionWithName:operation:bindToScope:")] - SentrySpan StartTransactionWithName(string name, string operation, bool bindToScope); + [Export ("startTransactionWithName:operation:bindToScope:")] + SentrySpan StartTransactionWithName (string name, string operation, bool bindToScope); - // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext; + // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext; [Static] - [Export("startTransactionWithContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext); + [Export ("startTransactionWithContext:")] + SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext); - // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope; + // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope; [Static] - [Export("startTransactionWithContext:bindToScope:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope); + [Export ("startTransactionWithContext:bindToScope:")] + SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, bool bindToScope); - // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; + // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext bindToScope:(BOOL)bindToScope customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; [Static] - [Export("startTransactionWithContext:bindToScope:customSamplingContext:")] - SentrySpan StartTransactionWithContext(SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); + [Export ("startTransactionWithContext:bindToScope:customSamplingContext:")] + SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, bool bindToScope, NSDictionary customSamplingContext); - // + (id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; + // +(id _Nonnull)startTransactionWithContext:(SentryTransactionContext * _Nonnull)transactionContext customSamplingContext:(NSDictionary * _Nonnull)customSamplingContext; [Static] [Export ("startTransactionWithContext:customSamplingContext:")] SentrySpan StartTransactionWithContext (SentryTransactionContext transactionContext, NSDictionary customSamplingContext); - // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; + // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error; [Static] [Export ("captureError:")] SentryId CaptureError (NSError error); - // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; + // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScope:(SentryScope * _Nonnull)scope; [Static] [Export ("captureError:withScope:")] SentryId CaptureError (NSError error, SentryScope scope); - // + (SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + // +(SentryId * _Nonnull)captureError:(NSError * _Nonnull)error withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; [Static] [Export ("captureError:withScopeBlock:")] SentryId CaptureError (NSError error, Action block); - // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; + // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception; [Static] [Export ("captureException:")] SentryId CaptureException (NSException exception); - // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; + // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScope:(SentryScope * _Nonnull)scope; [Static] [Export ("captureException:withScope:")] SentryId CaptureException (NSException exception, SentryScope scope); - // + (SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + // +(SentryId * _Nonnull)captureException:(NSException * _Nonnull)exception withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; [Static] [Export ("captureException:withScopeBlock:")] SentryId CaptureException (NSException exception, Action block); - // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; + // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message; [Static] [Export ("captureMessage:")] SentryId CaptureMessage (string message); - // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; + // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScope:(SentryScope * _Nonnull)scope; [Static] [Export ("captureMessage:withScope:")] SentryId CaptureMessage (string message, SentryScope scope); - // + (SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; + // +(SentryId * _Nonnull)captureMessage:(NSString * _Nonnull)message withScopeBlock:(void (^ _Nonnull)(SentryScope * _Nonnull))block; [Static] [Export ("captureMessage:withScopeBlock:")] SentryId CaptureMessage (string message, Action block); - // + (void) captureUserFeedback:(SentryUserFeedback* _Nonnull) userFeedback SWIFT_DEPRECATED_MSG("Use SentrySDK.back or use or configure our new managed UX with SentryOptions.configureUserFeedback."); + // +(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((deprecated("Use SentrySDK.back or use or configure our new managed UX with SentryOptions.configureUserFeedback."))); [Static] [Export ("captureUserFeedback:")] void CaptureUserFeedback (SentryUserFeedback userFeedback); - // + (void)captureFeedback:(SentryFeedback * _Nonnull)feedback; + // +(void)captureFeedback:(SentryFeedback * _Nonnull)feedback; [Static] [Export ("captureFeedback:")] void CaptureFeedback (SentryFeedback feedback); - // @property (nonatomic, class, readonly, strong) SentryFeedbackAPI * _Nonnull feedback SWIFT_AVAILABILITY(ios,introduced=13.0); + // @property (readonly, nonatomic, strong, class) SentryFeedbackAPI * _Nonnull feedback __attribute__((availability(ios, introduced=13.0))); [Static] - [Export ("feedback")] + [Export ("feedback", ArgumentSemantic.Strong)] SentryFeedbackAPI Feedback { get; } - // + (void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb; + // +(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb; [Static] [Export ("addBreadcrumb:")] void AddBreadcrumb (SentryBreadcrumb crumb); - // + (void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; + // +(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; [Static] [Export ("configureScope:")] void ConfigureScope (Action callback); - // @property (nonatomic, class, readonly) BOOL crashedLastRun; + // @property (readonly, nonatomic, class) BOOL crashedLastRun; [Static] [Export ("crashedLastRun")] bool CrashedLastRun { get; } - // property (nonatomic, class, readonly) BOOL detectedStartUpCrash; + // @property (readonly, nonatomic, class) BOOL detectedStartUpCrash; [Static] [Export ("detectedStartUpCrash")] bool DetectedStartUpCrash { get; } - // + (void)setUser:(SentryUser * _Nullable)user; + // +(void)setUser:(SentryUser * _Nullable)user; [Static] [Export ("setUser:")] void SetUser ([NullAllowed] SentryUser user); - // + (void)startSession; + // +(void)startSession; [Static] [Export ("startSession")] void StartSession (); - // + (void)endSession; + // +(void)endSession; [Static] [Export ("endSession")] void EndSession (); - // + (void)crash; + // +(void)crash; [Static] [Export ("crash")] void Crash (); - // + (void)reportFullyDisplayed; + // +(void)reportFullyDisplayed; [Static] [Export ("reportFullyDisplayed")] void ReportFullyDisplayed (); - // + (void)pauseAppHangTracking; + // +(void)pauseAppHangTracking; [Static] [Export ("pauseAppHangTracking")] void PauseAppHangTracking (); - // + (void)resumeAppHangTracking; + // +(void)resumeAppHangTracking; [Static] [Export ("resumeAppHangTracking")] void ResumeAppHangTracking (); - // + (void)flush:(NSTimeInterval)timeout; + // +(void)flush:(NSTimeInterval)timeout; [Static] [Export ("flush:")] void Flush (double timeout); - // + (void)close; + // +(void)close; [Static] [Export ("close")] void Close (); - // + (void)startProfiler; + // +(void)startProfiler; [Static] [Export ("startProfiler")] void StartProfiler (); - // + (void)stopProfiler; + // +(void)stopProfiler; [Static] [Export ("stopProfiler")] void StopProfiler (); - // + (void)clearLogger; - - // - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; - [Export("init")] - [DesignatedInitializer] - IntPtr Constructor(); + // +(void)clearLogger; + [Static] + [Export ("clearLogger")] + void ClearLogger (); } // @interface SentryUserFeedback : NSObject From 63f47b9c7992e5af42925f54757737d1ebf42fac Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 Sep 2025 11:17:33 +0200 Subject: [PATCH 04/10] Bump to 8.55.0 --- CHANGELOG.md | 6 ++-- modules/sentry-cocoa.properties | 2 +- scripts/generate-cocoa-bindings.ps1 | 1 + src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 36 +++++++++++++++---- .../Sentry.Bindings.Cocoa.csproj | 2 +- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b2d820e8c..e8050e6305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,9 +27,9 @@ - Bump CLI from v2.52.0 to v2.53.0 ([#4486](https://github.com/getsentry/sentry-dotnet/pull/4486)) - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2530) - [diff](https://github.com/getsentry/sentry-cli/compare/2.52.0...2.53.0) -- Bump sentry-cocoa from 8.46.0 to 8.54.0 ([#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) - - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8540) - - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.46.2...8.54.0) +- Bump sentry-cocoa from 8.46.0 to 8.55.0 ([#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8550) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.46.2...8.55.0) ## 5.14.1 diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index c1fb9cce1e..75e0af262e 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.54.0 +version = 8.55.0 repo = https://github.com/getsentry/sentry-cocoa diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 6776309942..04d44efeb6 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -222,6 +222,7 @@ $Text = $Text -replace '(SentrySamplingContext) arg\d', '$1 samplingContext' $Text = $Text -replace '(SentryBreadcrumb) arg\d', '$1 breadcrumb' $Text = $Text -replace '(SentrySpan) arg\d', '$1 span' $Text = $Text -replace '(SentryAppStartMeasurement) arg\d', '$1 appStartMeasurement' +$Text = $Text -replace '(SentryLog) arg\d', '$1 log' # Adjust nullable return delegates (though broken until this is fixed: https://github.com/xamarin/xamarin-macios/issues/17109) $Text = $Text -replace 'delegate \w+ Sentry(BeforeBreadcrumb|BeforeSendEvent|TracesSampler)Callback', "[return: NullAllowed]`n$&" diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 9c90c08c8b..31997fdfd7 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -34,6 +34,10 @@ namespace Sentry.CocoaSdk; [Internal] delegate SentrySpan SentryBeforeSendSpanCallback (SentrySpan span); +// typedef SentryLog * _Nullable (^SentryBeforeSendLogCallback)(SentryLog * _Nonnull); +[Internal] +delegate SentryLog SentryBeforeSendLogCallback (SentryLog log); + // typedef BOOL (^SentryBeforeCaptureScreenshotCallback)(SentryEvent * _Nonnull); [Internal] delegate bool SentryBeforeCaptureScreenshotCallback (SentryEvent @event); @@ -611,11 +615,11 @@ interface SentryException : SentrySerializable [Internal] interface SentryFeedbackAPI { - // -(void)showWidget __attribute__((availability(ios, introduced=13.0))); + // -(void)showWidget __attribute__((availability(ios, introduced=13.0))) __attribute__((availability(macos_app_extension, unavailable))) __attribute__((availability(ios_app_extension, unavailable))); [Export ("showWidget")] void ShowWidget (); - // -(void)hideWidget __attribute__((availability(ios, introduced=13.0))); + // -(void)hideWidget __attribute__((availability(ios, introduced=13.0))) __attribute__((availability(macos_app_extension, unavailable))) __attribute__((availability(ios_app_extension, unavailable))); [Export ("hideWidget")] void HideWidget (); } @@ -669,6 +673,18 @@ interface SentryFrame : SentrySerializable [NullAllowed, Export ("columnNumber", ArgumentSemantic.Copy)] NSNumber ColumnNumber { get; set; } + // @property (copy, nonatomic) NSString * _Nullable contextLine; + [NullAllowed, Export ("contextLine")] + string ContextLine { get; set; } + + // @property (copy, nonatomic) NSArray * _Nullable preContext; + [NullAllowed, Export ("preContext", ArgumentSemantic.Copy)] + string[] PreContext { get; set; } + + // @property (copy, nonatomic) NSArray * _Nullable postContext; + [NullAllowed, Export ("postContext", ArgumentSemantic.Copy)] + string[] PostContext { get; set; } + // @property (copy, nonatomic) NSNumber * _Nullable inApp; [NullAllowed, Export ("inApp", ArgumentSemantic.Copy)] NSNumber InApp { get; set; } @@ -676,6 +692,10 @@ interface SentryFrame : SentrySerializable // @property (copy, nonatomic) NSNumber * _Nullable stackStart; [NullAllowed, Export ("stackStart", ArgumentSemantic.Copy)] NSNumber StackStart { get; set; } + + // @property (copy, nonatomic) NSDictionary * _Nullable vars; + [NullAllowed, Export ("vars", ArgumentSemantic.Copy)] + NSDictionary Vars { get; set; } } // @interface SentryGeo : NSObject @@ -1389,6 +1409,10 @@ interface SentryOptions [NullAllowed, Export ("beforeSendSpan", ArgumentSemantic.Copy)] SentryBeforeSendSpanCallback BeforeSendSpan { get; set; } + // @property (copy, nonatomic) SentryBeforeSendLogCallback _Nullable beforeSendLog; + [NullAllowed, Export ("beforeSendLog", ArgumentSemantic.Copy)] + SentryBeforeSendLogCallback BeforeSendLog { get; set; } + // @property (copy, nonatomic) SentryBeforeBreadcrumbCallback _Nullable beforeBreadcrumb; [NullAllowed, Export ("beforeBreadcrumb", ArgumentSemantic.Copy)] SentryBeforeBreadcrumbCallback BeforeBreadcrumb { get; set; } @@ -1405,8 +1429,8 @@ interface SentryOptions [NullAllowed, Export ("onCrashedLastRun", ArgumentSemantic.Copy)] SentryOnCrashedLastRunCallback OnCrashedLastRun { get; set; } - // @property (copy, nonatomic) NSArray * _Nullable integrations; - [NullAllowed, Export ("integrations", ArgumentSemantic.Copy)] + // @property (copy, nonatomic) DEPRECATED_MSG_ATTRIBUTE("Setting `SentryOptions.integrations` is deprecated. Integrations should be enabled or disabled using their respective `SentryOptions.enable*` property.") NSArray * integrations __attribute__((deprecated("Setting `SentryOptions.integrations` is deprecated. Integrations should be enabled or disabled using their respective `SentryOptions.enable*` property."))); + [Export ("integrations", ArgumentSemantic.Copy)] string[] Integrations { get; set; } // +(NSArray * _Nonnull)defaultIntegrations; @@ -2311,10 +2335,10 @@ interface PrivateSentrySDKOnly [Export ("captureViewHierarchy")] NSData CaptureViewHierarchy(); - // +(void)setCurrentScreen:(NSString * _Nonnull)screenName; + // +(void)setCurrentScreen:(NSString * _Nullable)screenName; [Static] [Export ("setCurrentScreen:")] - void SetCurrentScreen (string screenName); + void SetCurrentScreen ([NullAllowed] string screenName); // +(UIView * _Nonnull)sessionReplayMaskingOverlay:(id _Nonnull)options; [Static] diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 0409fadeba..07bf94f189 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -75,7 +75,7 @@ - + Date: Wed, 3 Sep 2025 11:27:07 +0200 Subject: [PATCH 05/10] Add SentryLog --- .../SwiftApiDefinitions.cs | 31 +++++++++++++++++++ .../SwiftStructsAndEnums.cs | 11 +++++++ 2 files changed, 42 insertions(+) diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs index 2d7de3da8c..780be4d467 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs @@ -66,6 +66,37 @@ interface SentryId nuint Hash { get; } } +// @interface SentryLog : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry9SentryLog")] +[DisableDefaultCtor] +[Internal] +interface SentryLog +{ + // @property (copy, nonatomic) NSDate * _Nonnull timestamp; + [Export ("timestamp", ArgumentSemantic.Copy)] + NSDate Timestamp { get; set; } + + // @property (nonatomic, strong) SentryId * _Nonnull traceId; + [Export ("traceId", ArgumentSemantic.Strong)] + SentryId TraceId { get; set; } + + // @property (nonatomic) enum SentryStructuredLogLevel level; + [Export ("level", ArgumentSemantic.Assign)] + SentryStructuredLogLevel Level { get; set; } + + // @property (copy, nonatomic) NSString * _Nonnull body; + [Export ("body")] + string Body { get; set; } + + // @property (copy, nonatomic) NSDictionary * _Nonnull attributes; + [Export ("attributes", ArgumentSemantic.Copy)] + NSDictionary Attributes { get; set; } + + // @property (nonatomic, strong) NSNumber * _Nullable severityNumber; + [NullAllowed, Export ("severityNumber", ArgumentSemantic.Strong)] + NSNumber SeverityNumber { get; set; } +} + // @interface SentryLogger : NSObject [BaseType (typeof(NSObject), Name = "_TtC6Sentry12SentryLogger")] [DisableDefaultCtor] diff --git a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs index 5cc5cc81c7..0e4a48bec7 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs @@ -29,6 +29,17 @@ internal enum SentryLevel : ulong Fatal = 5 } +[Native] +internal enum SentryStructuredLogLevel : long +{ + Trace = 0, + Debug = 1, + Info = 2, + Warn = 3, + Error = 4, + Fatal = 5 +} + [Native] internal enum SentryProfileLifecycle : long { From 88f2189c2e99331df8388fee64f40e79ff311fd0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 Sep 2025 10:08:40 +0200 Subject: [PATCH 06/10] Fix SentryFeedbackSource enum --- src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs index 0e4a48bec7..806daffd87 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs @@ -12,10 +12,8 @@ namespace Sentry.CocoaSdk; [Native] internal enum SentryFeedbackSource : long { - Unknown = 0, - User = 1, - System = 2, - Other = 3 + Widget = 0, + Custom = 1 } [Native] From ff9f7a988b9e72162eaae9197d9500bc1fe9eb66 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 3 Sep 2025 15:26:17 +0200 Subject: [PATCH 07/10] Try Sentry-Dynamic-WithARM64e.xcframework --- src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 07bf94f189..2ae3c65283 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -66,16 +66,16 @@ + Command="curl -L https://github.com/getsentry/sentry-cocoa/releases/download/$(SentryCocoaVersion)/Sentry-Dynamic-WithARM64e.xcframework.zip -o $(SentryCocoaFramework).zip" /> + Command="unzip -o $(SentryCocoaFramework).zip -d $(SentryCocoaCache) && mv $(SentryCocoaCache)Sentry-Dynamic-WithARM64e.xcframework $(SentryCocoaFramework)" /> - + Date: Thu, 4 Sep 2025 14:43:33 +0200 Subject: [PATCH 08/10] 8.55.1 --- modules/sentry-cocoa.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index 75e0af262e..cb992f6d1a 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.55.0 +version = 8.55.1 repo = https://github.com/getsentry/sentry-cocoa From 9dbdd3227d5fd0536a1a1ce1daa501d38d42a19b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 4 Sep 2025 20:48:42 +0200 Subject: [PATCH 09/10] Revert "Try Sentry-Dynamic-WithARM64e.xcframework" This reverts commit ff9f7a988b9e72162eaae9197d9500bc1fe9eb66. --- src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 2ae3c65283..07bf94f189 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -66,16 +66,16 @@ + Command="curl -L https://github.com/getsentry/sentry-cocoa/releases/download/$(SentryCocoaVersion)/Sentry-Dynamic.xcframework.zip -o $(SentryCocoaFramework).zip" /> + Command="unzip -o $(SentryCocoaFramework).zip -d $(SentryCocoaCache) && mv $(SentryCocoaCache)Sentry-Dynamic.xcframework $(SentryCocoaFramework)" /> - + Date: Thu, 4 Sep 2025 20:53:38 +0200 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8050e6305..6b90881027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,9 +27,9 @@ - Bump CLI from v2.52.0 to v2.53.0 ([#4486](https://github.com/getsentry/sentry-dotnet/pull/4486)) - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2530) - [diff](https://github.com/getsentry/sentry-cli/compare/2.52.0...2.53.0) -- Bump sentry-cocoa from 8.46.0 to 8.55.0 ([#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) - - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8550) - - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.46.2...8.55.0) +- Bump sentry-cocoa from 8.46.0 to 8.55.1 ([#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8551) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.46.2...8.55.1) ## 5.14.1