diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc59b8f81..dab2ce1935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ - Fail when building Blazor WASM with Profiling. We don't support profiling in Blazor WebAssembly projects. ([#4512](https://github.com/getsentry/sentry-dotnet/pull/4512)) - Do not overwrite user IP if it is set manually in ASP.NET sdk ([#4513](https://github.com/getsentry/sentry-dotnet/pull/4513)) +### Dependencies + +- Bump Cocoa SDK from v8.55.1 to v8.56.0 ([#4528](https://github.com/getsentry/sentry-dotnet/pull/4528)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8560) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.55.1...8.56.0) + ## 5.15.0 ### Features diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index cb992f6d1a..d4dde9863e 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.55.1 +version = 8.56.0 repo = https://github.com/getsentry/sentry-cocoa diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 04d44efeb6..eb1295808e 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -278,9 +278,6 @@ $Text = $Text -replace '([\[,] )iOS \(', '$1Introduced (PlatformName.iOS, ' # Make interface partial if we need to access private APIs. Other parts will be defined in PrivateApiDefinitions.cs $Text = $Text -replace '(?m)^interface SentryScope', 'partial $&' -# Prefix SentryBreadcrumb.Serialize and SentryScope.Serialize with new (since these hide the base method) -$Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*\[Export \("serialize"\)\]$\s*)(NSDictionary)', '${1}new $2' - $Text = $Text -replace '.*SentryEnvelope .*?[\s\S]*?\n\n', '' $Text = $Text -replace '.*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n', '' diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 31997fdfd7..f33b1c6815 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -225,7 +225,7 @@ interface SentryBreadcrumb : SentrySerializable // -(NSDictionary * _Nonnull)serialize; [Export ("serialize")] - new NSDictionary Serialize(); + NSDictionary Serialize(); // -(BOOL)isEqualToBreadcrumb:(SentryBreadcrumb * _Nonnull)breadcrumb; [Export ("isEqualToBreadcrumb:")] @@ -930,6 +930,11 @@ interface SentrySpan : SentrySerializable [Abstract] [NullAllowed, Export ("baggageHttpHeader")] string BaggageHttpHeader { get; } + + // @required -(NSDictionary * _Nonnull)serialize; + [Abstract] + [Export ("serialize")] + NSDictionary Serialize(); } // @interface SentryHub : NSObject @@ -1494,6 +1499,10 @@ interface SentryOptions [Export ("attachScreenshot")] bool AttachScreenshot { get; set; } + // @property (nonatomic, strong) SentryViewScreenshotOptions * _Nonnull screenshot; + [Export ("screenshot", ArgumentSemantic.Strong)] + SentryViewScreenshotOptions Screenshot { get; set; } + // @property (assign, nonatomic) BOOL attachViewHierarchy; [Export ("attachViewHierarchy")] bool AttachViewHierarchy { get; set; } @@ -1864,7 +1873,7 @@ partial interface SentryScope : SentrySerializable // -(NSDictionary * _Nonnull)serialize; [Export ("serialize")] - new NSDictionary Serialize(); + NSDictionary Serialize(); // -(void)setContextValue:(NSDictionary * _Nonnull)value forKey:(NSString * _Nonnull)key __attribute__((swift_name("setContext(value:key:)"))); [Export ("setContextValue:forKey:")] diff --git a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs index ccd5d1865d..55f59db3fe 100644 --- a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs @@ -17,13 +17,6 @@ partial interface SentryScope // The following types are type-forwarded in various public headers, but have no headers of their own. // Generate stub classes so the APIs that use them can still operate. -[Internal] -[DisableDefaultCtor] -[BaseType (typeof(NSObject))] -interface SentrySession -{ -} - [Internal] [DisableDefaultCtor] [BaseType (typeof(NSObject))] diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 07bf94f189..98e6fde2d2 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -12,6 +12,8 @@ $([System.IO.File]::ReadAllText("$(MSBuildThisFileDirectory)../../modules/sentry-cocoa.properties")) $([System.Text.RegularExpressions.Regex]::Match($(SentryCocoaProperties), 'version\s*=\s*([^\s]+)').Groups[1].Value) $(SentryCocoaCache)Sentry-$(SentryCocoaVersion).xcframework + + $(NoWarn);CS0108 diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs index 780be4d467..391360da15 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs @@ -556,6 +556,103 @@ interface SentrySDK void ClearLogger (); } +// @interface SentrySession : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry13SentrySession")] +[DisableDefaultCtor] +[Internal] +interface SentrySession +{ + // -(instancetype _Nonnull)initWithReleaseName:(NSString * _Nonnull)releaseName distinctId:(NSString * _Nonnull)distinctId __attribute__((objc_designated_initializer)); + [Export ("initWithReleaseName:distinctId:")] + [DesignatedInitializer] + NativeHandle Constructor (string releaseName, string distinctId); + + // -(instancetype _Nullable)initWithJSONObject:(NSDictionary * _Nonnull)jsonObject __attribute__((objc_designated_initializer)); + [Export ("initWithJSONObject:")] + [DesignatedInitializer] + NativeHandle Constructor (NSDictionary jsonObject); + + // -(void)endSessionExitedWithTimestamp:(NSDate * _Nonnull)timestamp; + [Export ("endSessionExitedWithTimestamp:")] + void EndSessionExitedWithTimestamp (NSDate timestamp); + + // -(void)endSessionCrashedWithTimestamp:(NSDate * _Nonnull)timestamp; + [Export ("endSessionCrashedWithTimestamp:")] + void EndSessionCrashedWithTimestamp (NSDate timestamp); + + // -(void)endSessionAbnormalWithTimestamp:(NSDate * _Nonnull)timestamp; + [Export ("endSessionAbnormalWithTimestamp:")] + void EndSessionAbnormalWithTimestamp (NSDate timestamp); + + // -(void)incrementErrors; + [Export ("incrementErrors")] + void IncrementErrors (); + + // @property (readonly, copy, nonatomic) NSUUID * _Nonnull sessionId; + [Export ("sessionId", ArgumentSemantic.Copy)] + NSUuid SessionId { get; } + + // @property (readonly, copy, nonatomic) NSDate * _Nonnull started; + [Export ("started", ArgumentSemantic.Copy)] + NSDate Started { get; } + + // @property (readonly, nonatomic) enum SentrySessionStatus status; + [Export ("status")] + SentrySessionStatus Status { get; } + + // @property (nonatomic) NSUInteger errors; + [Export ("errors")] + nuint Errors { get; set; } + + // @property (readonly, nonatomic) NSUInteger sequence; + [Export ("sequence")] + nuint Sequence { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull distinctId; + [Export ("distinctId")] + string DistinctId { get; } + + // @property (readonly, nonatomic, strong) NSNumber * _Nullable flagInit; + [NullAllowed, Export ("flagInit", ArgumentSemantic.Strong)] + NSNumber FlagInit { get; } + + // @property (readonly, copy, nonatomic) NSDate * _Nullable timestamp; + [NullAllowed, Export ("timestamp", ArgumentSemantic.Copy)] + NSDate Timestamp { get; } + + // @property (readonly, nonatomic, strong) NSNumber * _Nullable duration; + [NullAllowed, Export ("duration", ArgumentSemantic.Strong)] + NSNumber Duration { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable releaseName; + [NullAllowed, Export ("releaseName")] + string ReleaseName { get; } + + // @property (copy, nonatomic) NSString * _Nullable environment; + [NullAllowed, Export ("environment")] + string Environment { get; set; } + + // @property (nonatomic, strong) SentryUser * _Nullable user; + [NullAllowed, Export ("user", ArgumentSemantic.Strong)] + SentryUser User { get; set; } + + // @property (copy, nonatomic) NSString * _Nullable abnormalMechanism; + [NullAllowed, Export ("abnormalMechanism")] + string AbnormalMechanism { get; set; } + + // -(NSDictionary * _Nonnull)serialize __attribute__((warn_unused_result(""))); + [Export ("serialize")] + NSDictionary Serialize(); + + // -(void)setFlagInit; + [Export ("setFlagInit")] + void SetFlagInit (); + + // -(id _Nonnull)copyWithZone:(struct _NSZone * _Nullable)zone __attribute__((warn_unused_result(""))); + // [Export ("copyWithZone:")] + // unsafe NSObject CopyWithZone ([NullAllowed] _NSZone* zone); +} + // @interface SentryUserFeedback : NSObject [BaseType(typeof(NSObject))] [DisableDefaultCtor] @@ -750,6 +847,41 @@ interface SentryUserFeedbackWidgetConfiguration // IntPtr Constructor(); // } +// @interface SentryViewScreenshotOptions : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry27SentryViewScreenshotOptions")] +[Internal] +interface SentryViewScreenshotOptions //: ISentryRedactOptions +{ + // @property (nonatomic) BOOL enableViewRendererV2; + [Export ("enableViewRendererV2")] + bool EnableViewRendererV2 { get; set; } + + // @property (nonatomic) BOOL enableFastViewRendering; + [Export ("enableFastViewRendering")] + bool EnableFastViewRendering { get; set; } + + // @property (nonatomic) BOOL maskAllImages; + [Export ("maskAllImages")] + bool MaskAllImages { get; set; } + + // @property (nonatomic) BOOL maskAllText; + [Export ("maskAllText")] + bool MaskAllText { get; set; } + + // @property (copy, nonatomic) NSArray * _Nonnull maskedViewClasses; + [Export ("maskedViewClasses", ArgumentSemantic.Copy)] + Class[] MaskedViewClasses { get; set; } + + // @property (copy, nonatomic) NSArray * _Nonnull unmaskedViewClasses; + [Export ("unmaskedViewClasses", ArgumentSemantic.Copy)] + Class[] UnmaskedViewClasses { get; set; } + + // -(instancetype _Nonnull)initWithEnableViewRendererV2:(BOOL)enableViewRendererV2 enableFastViewRendering:(BOOL)enableFastViewRendering maskAllText:(BOOL)maskAllText maskAllImages:(BOOL)maskAllImages maskedViewClasses:(NSArray * _Nonnull)maskedViewClasses unmaskedViewClasses:(NSArray * _Nonnull)unmaskedViewClasses __attribute__((objc_designated_initializer)); + [Export ("initWithEnableViewRendererV2:enableFastViewRendering:maskAllText:maskAllImages:maskedViewClasses:unmaskedViewClasses:")] + [DesignatedInitializer] + NativeHandle Constructor (bool enableViewRendererV2, bool enableFastViewRendering, bool maskAllText, bool maskAllImages, Class[] maskedViewClasses, Class[] unmaskedViewClasses); +} + // @protocol SentryViewScreenshotProvider [Protocol (Name = "_TtP6Sentry28SentryViewScreenshotProvider_")] [Model] diff --git a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs index 806daffd87..1453151744 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs @@ -69,6 +69,15 @@ internal enum SentryRRWebEventType : long Custom = 5 } +[Native] +internal enum SentrySessionStatus : ulong +{ + Ok = 0, + Exited = 1, + Crashed = 2, + Abnormal = 3 +} + [Native] internal enum SentryTransactionNameSource : long {