From 8bc5af4a785ae2abb938a50adb51fffbab4b9117 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 20 May 2025 10:36:02 +1200 Subject: [PATCH 1/2] Revert "Bump to cocoa sdk v8.46.0 (#4103)" This reverts commit 690a1697 --- Directory.Build.props | 2 +- Directory.Build.targets | 2 +- modules/sentry-cocoa.properties | 2 +- .../Sentry.Samples.Maui.csproj | 2 +- scripts/generate-cocoa-bindings.ps1 | 80 +++- src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 188 +++----- .../Sentry.Bindings.Cocoa.csproj | 2 - src/Sentry.Bindings.Cocoa/StructsAndEnums.cs | 22 + .../SwiftApiDefinitions.cs | 405 ------------------ .../SwiftStructsAndEnums.cs | 65 --- 10 files changed, 156 insertions(+), 614 deletions(-) delete mode 100644 src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs delete mode 100644 src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs diff --git a/Directory.Build.props b/Directory.Build.props index c6b2e14f95..0a61d0388e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -50,7 +50,7 @@ --> $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - 13.0 + 12.2 15.0 21.0 10.0.17763.0 diff --git a/Directory.Build.targets b/Directory.Build.targets index b01536755f..7593967e09 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,7 +10,7 @@ --> $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - 13.0 + 12.2 15.0 21.0 10.0.17763.0 diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index 9d8498fef2..799f17ac06 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.46.0 +version = 8.39.0 repo = https://github.com/getsentry/sentry-cocoa diff --git a/samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj b/samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj index 2ccb179b00..f924e8f7c0 100644 --- a/samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj +++ b/samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj @@ -32,7 +32,7 @@ 1.0 1 - 13.0 + 12.2 15.0 21.0 10.0.17763.0 diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 0684bd7b56..1a9f7a6a9e 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -1,5 +1,3 @@ -# Reference: https://github.com/xamarin/xamarin-macios/blob/main/docs/website/binding_types_reference_guide.md - Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -117,6 +115,41 @@ $Text = $Text -replace '\bpublic\b', 'internal' # Remove static CFunctions class $Text = $Text -replace '(?ms)\nstatic class CFunctions.*?}\n', '' +# This enum resides in the Sentry-Swift.h +# Appending it here so we don't need to import and create bindings for the entire header +$SentryLevel = @' + +[Native] +internal enum SentryLevel : ulong +{ + None = 0, + Debug = 1, + Info = 2, + Warning = 3, + Error = 4, + Fatal = 5 +} +'@ + +# This enum resides in the Sentry-Swift.h +# Appending it here so we don't need to import and create bindings for the entire header +$SentryTransactionNameSource = @' + +[Native] +internal enum SentryTransactionNameSource : long +{ + Custom = 0, + Url = 1, + Route = 2, + View = 3, + Component = 4, + Task = 5 +} +'@ + +$Text += "`n$SentryLevel" +$Text += "`n$SentryTransactionNameSource" + # Add header and output file $Text = "$Header`n`n$Text" $Text | Out-File "$BindingsPath/$File" @@ -147,9 +180,6 @@ $Text = $Text -replace '\bISentrySerializable\b', 'SentrySerializable' # Remove INSCopying due to https://github.com/xamarin/xamarin-macios/issues/17130 $Text = $Text -replace ': INSCopying,', ':' -replace '\s?[:,] INSCopying', '' -# Remove iOS attributes like [iOS (13, 0)] -$Text = $Text -replace '\[iOS \(13, 0\)\]\n?', '' - # Fix delegate argument names $Text = $Text -replace '(NSError) arg\d', '$1 error' $Text = $Text -replace '(NSHttpUrlResponse) arg\d', '$1 response' @@ -191,7 +221,7 @@ $Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Consta # Update MethodToProperty translations $Text = $Text -replace '(Export \("get\w+"\)\]\n)\s*\[Verify \(MethodToProperty\)\]\n(.+ \{ get; \})', '$1$2' -$Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations|AppStartMeasurementWithSpans|BaggageHttpHeader) \{ get; \})', '$1' +$Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations) \{ get; \})', '$1' $Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+) \{ get; \}', '$1();' # Allow weakly typed NSArray @@ -204,7 +234,7 @@ $Text = $Text -replace '(DEPRECATED_MSG_ATTRIBUTE\()\n\s*', '$1' # Remove default IsEqual implementation (already implemented by NSObject) $Text = $Text -replace '(?ms)\n?^ *// [^\n]*isEqual:.*?$.*?;\n', '' -# Replace obsolete platform availability attributes +# Replace obsolete platform avaialbility attributes $Text = $Text -replace '([\[,] )MacCatalyst \(', '$1Introduced (PlatformName.MacCatalyst, ' $Text = $Text -replace '([\[,] )Mac \(', '$1Introduced (PlatformName.MacOSX, ' $Text = $Text -replace '([\[,] )iOS \(', '$1Introduced (PlatformName.iOS, ' @@ -217,6 +247,7 @@ $Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*\[Export \("serialize"\)\]$\s*) $Text = $Text -replace '.*SentryEnvelope .*?[\s\S]*?\n\n', '' $Text = $Text -replace '.*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n', '' +$Text = $Text -replace '\n.*SentryReplayBreadcrumbConverter.*?[\s\S]*?\);\n', '' $propertiesToRemove = @( 'SentryAppStartMeasurement', @@ -231,6 +262,41 @@ foreach ($property in $propertiesToRemove) { $Text = $Text -replace "\n.*property.*$property.*?[\s\S]*?\}\n", '' } +# This interface resides in the Sentry-Swift.h +# Appending it here so we don't need to import and create bindings for the entire header +$SentryId = @' + +// @interface SentryId : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")] +[Internal] +interface SentryId +{ + // @property (nonatomic, strong, class) SentryId * _Nonnull empty; + [Static] + [Export ("empty", ArgumentSemantic.Strong)] + SentryId Empty { get; set; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; + [Export ("sentryIdString")] + string SentryIdString { get; } + + // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer)); + [Export ("initWithUuid:")] + [DesignatedInitializer] + NativeHandle Constructor (NSUuid uuid); + + // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer)); + [Export ("initWithUUIDString:")] + [DesignatedInitializer] + NativeHandle Constructor (string uuidString); + + // @property (readonly, nonatomic) NSUInteger hash; + [Export ("hash")] + nuint Hash { get; } +} +'@ + +$Text += "`n$SentryId" # Add header and output file $Text = "$Header`n`n$Text" diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index cf38a5e4b4..77ad1d5797 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -27,7 +27,6 @@ namespace Sentry.CocoaSdk; // typedef SentryEvent * _Nullable (^SentryBeforeSendEventCallback)(SentryEvent * _Nonnull); [Internal] -[return: NullAllowed] delegate SentryEvent SentryBeforeSendEventCallback (SentryEvent @event); // typedef id _Nullable (^SentryBeforeSendSpanCallback)(id _Nonnull); @@ -55,13 +54,13 @@ namespace Sentry.CocoaSdk; [return: NullAllowed] delegate NSNumber SentryTracesSamplerCallback (SentrySamplingContext samplingContext); -// typedef void (^SentrySpanCallback)(DEPRECATED_MSG_ATTRIBUTE("See `SentryScope.useSpan` for reasoning of deprecation.") id); +// typedef void (^SentrySpanCallback)(id _Nullable); [Internal] -delegate void SentrySpanCallback (SentrySpan span); +delegate void SentrySpanCallback ([NullAllowed] SentrySpan span); -// typedef void (^SentryUserFeedbackConfigurationBlock)(SentryUserFeedbackConfiguration * _Nonnull); +// typedef BOOL (^SentryBeforeEmitMetricCallback)(NSString * _Nonnull, NSDictionary * _Nonnull); [Internal] -delegate void SentryUserFeedbackConfigurationBlock (SentryUserFeedbackConfiguration arg0); +delegate bool SentryBeforeEmitMetricCallback (string arg0, NSDictionary arg1); // @interface SentryAttachment : NSObject [BaseType (typeof(NSObject))] @@ -139,10 +138,6 @@ interface SentryBaggage [NullAllowed, Export ("userSegment")] string UserSegment { get; } - // @property (readonly, nonatomic) NSString * _Nullable sampleRand; - [NullAllowed, Export ("sampleRand")] - string SampleRand { get; } - // @property (readonly, nonatomic) NSString * _Nullable sampleRate; [NullAllowed, Export ("sampleRate")] string SampleRate { get; } @@ -159,10 +154,6 @@ interface SentryBaggage [Export ("initWithTraceId:publicKey:releaseName:environment:transaction:userSegment:sampleRate:sampled:replayId:")] NativeHandle Constructor (SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string userSegment, [NullAllowed] string sampleRate, [NullAllowed] string sampled, [NullAllowed] string replayId); - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction userSegment:(NSString * _Nullable)userSegment sampleRate:(NSString * _Nullable)sampleRate sampleRand:(NSString * _Nullable)sampleRand sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId; - [Export ("initWithTraceId:publicKey:releaseName:environment:transaction:userSegment:sampleRate:sampleRand:sampled:replayId:")] - NativeHandle Constructor (SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string userSegment, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId); - // -(NSString * _Nonnull)toHTTPHeaderWithOriginalBaggage:(NSDictionary * _Nullable)originalBaggage; [Export ("toHTTPHeaderWithOriginalBaggage:")] string ToHTTPHeaderWithOriginalBaggage ([NullAllowed] NSDictionary originalBaggage); @@ -207,10 +198,6 @@ interface SentryBreadcrumb : SentrySerializable [NullAllowed, Export ("message")] string Message { get; set; } - // @property (copy, nonatomic) NSString * _Nullable origin; - [NullAllowed, Export ("origin")] - string Origin { get; set; } - // @property (nonatomic, strong) NSDictionary * _Nullable data; [NullAllowed, Export ("data", ArgumentSemantic.Strong)] NSDictionary Data { get; set; } @@ -282,14 +269,10 @@ interface SentryClient [Export ("captureMessage:withScope:")] SentryId CaptureMessage (string message, SentryScope scope); - // -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))) __attribute__((deprecated("Use -[SentryClient captureFeedback:withScope:]."))); + // -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))); [Export ("captureUserFeedback:")] void CaptureUserFeedback (SentryUserFeedback userFeedback); - // -(void)captureFeedback:(SentryFeedback * _Nonnull)feedback withScope:(SentryScope * _Nonnull)scope __attribute__((swift_name("capture(feedback:scope:)"))); - [Export ("captureFeedback:withScope:")] - void CaptureFeedback (SentryFeedback feedback, SentryScope scope); - // -(void)flush:(NSTimeInterval)timeout __attribute__((swift_name("flush(timeout:)"))); [Export ("flush:")] void Flush (double timeout); @@ -299,6 +282,13 @@ interface SentryClient void Close (); } +// @interface SentryCrashExceptionApplication : NSObject +[BaseType (typeof(NSObject))] +[Internal] +interface SentryCrashExceptionApplication +{ +} + // @interface SentryDebugImageProvider : NSObject [BaseType (typeof(NSObject))] [Internal] @@ -308,7 +298,7 @@ interface SentryDebugImageProvider [Export ("getDebugImagesForThreads:")] SentryDebugMeta[] GetDebugImagesForThreads (SentryThread[] threads); - // -(NSArray * _Nonnull)getDebugImagesForThreads:(NSArray * _Nonnull)threads isCrash:(BOOL)isCrash __attribute__((deprecated("This method is slow and will be removed in a future version. Use -[getDebugImagesFromCacheForThreads:] instead."))); + // -(NSArray * _Nonnull)getDebugImagesForThreads:(NSArray * _Nonnull)threads isCrash:(BOOL)isCrash; [Export ("getDebugImagesForThreads:isCrash:")] SentryDebugMeta[] GetDebugImagesForThreads (SentryThread[] threads, bool isCrash); @@ -316,7 +306,7 @@ interface SentryDebugImageProvider [Export ("getDebugImagesForFrames:")] SentryDebugMeta[] GetDebugImagesForFrames (SentryFrame[] frames); - // -(NSArray * _Nonnull)getDebugImagesForFrames:(NSArray * _Nonnull)frames isCrash:(BOOL)isCrash __attribute__((deprecated("This method is slow and will be removed in a future version. Use -[getDebugImagesFromCacheForFrames:] instead."))); + // -(NSArray * _Nonnull)getDebugImagesForFrames:(NSArray * _Nonnull)frames isCrash:(BOOL)isCrash; [Export ("getDebugImagesForFrames:isCrash:")] SentryDebugMeta[] GetDebugImagesForFrames (SentryFrame[] frames, bool isCrash); @@ -324,7 +314,7 @@ interface SentryDebugImageProvider [Export ("getDebugImages")] SentryDebugMeta[] DebugImages { get; } - // -(NSArray * _Nonnull)getDebugImagesCrashed:(BOOL)isCrash __attribute__((deprecated("This method is slow and will be removed in a future version. Use -[getDebugImagesFromCache:] instead."))); + // -(NSArray * _Nonnull)getDebugImagesCrashed:(BOOL)isCrash; [Export ("getDebugImagesCrashed:")] SentryDebugMeta[] GetDebugImagesCrashed (bool isCrash); } @@ -559,13 +549,6 @@ interface SentryEvent : SentrySerializable NativeHandle Constructor (NSError error); } -// @interface SentryEventDecodable : SentryEvent -[BaseType (typeof(SentryEvent))] -[Internal] -interface SentryEventDecodable -{ -} - // @interface SentryException : NSObject [BaseType (typeof(NSObject))] [DisableDefaultCtor] @@ -890,7 +873,7 @@ interface SentrySpan : SentrySerializable // @required -(NSString * _Nullable)baggageHttpHeader; [Abstract] [NullAllowed, Export ("baggageHttpHeader")] - string BaggageHttpHeader { get; } + string BaggageHttpHeader(); } // @interface SentryHub : NSObject @@ -971,14 +954,10 @@ interface SentryHub [Export ("captureMessage:withScope:")] SentryId CaptureMessage (string message, SentryScope scope); - // -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))) __attribute__((deprecated("Use -[SentryHub captureFeedback:]."))); + // -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))); [Export ("captureUserFeedback:")] void CaptureUserFeedback (SentryUserFeedback userFeedback); - // -(void)captureFeedback:(SentryFeedback * _Nonnull)feedback; - [Export ("captureFeedback:")] - void CaptureFeedback (SentryFeedback feedback); - // -(void)configureScope:(void (^ _Nonnull)(SentryScope * _Nonnull))callback; [Export ("configureScope:")] void ConfigureScope (Action callback); @@ -1418,10 +1397,6 @@ interface SentryOptions [Export ("enablePerformanceV2")] bool EnablePerformanceV2 { get; set; } - // @property (assign, nonatomic) BOOL enablePersistingTracesWhenCrashing; - [Export ("enablePersistingTracesWhenCrashing")] - bool EnablePersistingTracesWhenCrashing { get; set; } - // @property (nonatomic) SentryScope * _Nonnull (^ _Nonnull)(SentryScope * _Nonnull) initialScope; [Export ("initialScope", ArgumentSemantic.Assign)] Func InitialScope { get; set; } @@ -1454,10 +1429,6 @@ interface SentryOptions [Export ("enablePreWarmedAppStartTracing")] bool EnablePreWarmedAppStartTracing { get; set; } - // @property (nonatomic, strong) SentryReplayOptions * _Nonnull sessionReplay; - [Export ("sessionReplay", ArgumentSemantic.Strong)] - SentryReplayOptions SessionReplay { get; set; } - // @property (assign, nonatomic) BOOL enableNetworkTracking; [Export ("enableNetworkTracking")] bool EnableNetworkTracking { get; set; } @@ -1604,10 +1575,6 @@ interface SentryOptions // @property (copy, nonatomic) NSString * _Nonnull spotlightUrl; [Export ("spotlightUrl")] string SpotlightUrl { get; set; } - - // @property (copy, nonatomic) API_AVAILABLE(ios(13.0)) SentryUserFeedbackConfigurationBlock configureUserFeedback __attribute__((availability(ios, introduced=13.0))); - [Export ("configureUserFeedback", ArgumentSemantic.Copy)] - SentryUserFeedbackConfigurationBlock ConfigureUserFeedback { get; set; } } // @interface SentryReplayApi : NSObject @@ -1638,18 +1605,6 @@ interface SentryReplayApi // -(void)stop; [Export ("stop")] void Stop (); - - // -(void)showMaskPreview; - [Export ("showMaskPreview")] - void ShowMaskPreview (); - - // -(void)showMaskPreview:(CGFloat)opacity; - [Export ("showMaskPreview:")] - void ShowMaskPreview (nfloat opacity); - - // -(void)hideMaskPreview; - [Export ("hideMaskPreview")] - void HideMaskPreview (); } // @interface SentryRequest : NSObject @@ -1807,15 +1762,15 @@ interface SentrySDK [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."))); + // +(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))); [Static] [Export ("captureUserFeedback:")] void CaptureUserFeedback (SentryUserFeedback userFeedback); - // +(void)captureFeedback:(SentryFeedback * _Nonnull)feedback __attribute__((swift_name("capture(feedback:)"))); + // +(void)showUserFeedbackForm; [Static] - [Export ("captureFeedback:")] - void CaptureFeedback (SentryFeedback feedback); + [Export ("showUserFeedbackForm")] + void ShowUserFeedbackForm (); // +(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb __attribute__((swift_name("addBreadcrumb(_:)"))); [Static] @@ -2025,7 +1980,7 @@ partial interface SentryScope : SentrySerializable [Export ("clear")] void Clear (); - // -(void)useSpan:(SentrySpanCallback _Nonnull)callback __attribute__((deprecated("This method was used to create an atomic block that could be used to mutate the current span. It is not atomic anymore and due to issues with memory safety in `NSBlock` it is now considered unsafe and deprecated. Use `span` instead."))); + // -(void)useSpan:(SentrySpanCallback _Nonnull)callback; [Export ("useSpan:")] void UseSpan (SentrySpanCallback callback); } @@ -2148,10 +2103,6 @@ interface SentryTraceContext : SentrySerializable [NullAllowed, Export ("sampleRate")] string SampleRate { get; } - // @property (readonly, nonatomic) NSString * _Nullable sampleRand; - [NullAllowed, Export ("sampleRand")] - string SampleRand { get; } - // @property (readonly, nonatomic) NSString * _Nullable sampled; [NullAllowed, Export ("sampled")] string Sampled { get; } @@ -2164,10 +2115,6 @@ interface SentryTraceContext : SentrySerializable [Export ("initWithTraceId:publicKey:releaseName:environment:transaction:userSegment:sampleRate:sampled:replayId:")] NativeHandle Constructor (SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string userSegment, [NullAllowed] string sampleRate, [NullAllowed] string sampled, [NullAllowed] string replayId); - // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction userSegment:(NSString * _Nullable)userSegment sampleRate:(NSString * _Nullable)sampleRate sampleRand:(NSString * _Nullable)sampleRand sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId; - [Export ("initWithTraceId:publicKey:releaseName:environment:transaction:userSegment:sampleRate:sampleRand:sampled:replayId:")] - NativeHandle Constructor (SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string userSegment, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId); - // -(instancetype _Nullable)initWithScope:(SentryScope * _Nonnull)scope options:(SentryOptions * _Nonnull)options; [Export ("initWithScope:options:")] NativeHandle Constructor (SentryScope scope, SentryOptions options); @@ -2230,25 +2177,13 @@ interface SentryTransactionContext [Export ("nameSource")] SentryTransactionNameSource NameSource { get; } - // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; - [NullAllowed, Export ("sampleRate", ArgumentSemantic.Strong)] - NSNumber SampleRate { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable sampleRand; - [NullAllowed, Export ("sampleRand", ArgumentSemantic.Strong)] - NSNumber SampleRand { get; set; } - // @property (nonatomic) SentrySampleDecision parentSampled; [Export ("parentSampled", ArgumentSemantic.Assign)] SentrySampleDecision ParentSampled { get; set; } - // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRate; - [NullAllowed, Export ("parentSampleRate", ArgumentSemantic.Strong)] - NSNumber ParentSampleRate { get; set; } - - // @property (nonatomic, strong) NSNumber * _Nullable parentSampleRand; - [NullAllowed, Export ("parentSampleRand", ArgumentSemantic.Strong)] - NSNumber ParentSampleRand { get; set; } + // @property (nonatomic, strong) NSNumber * _Nullable sampleRate; + [NullAllowed, Export ("sampleRate", ArgumentSemantic.Strong)] + NSNumber SampleRate { get; set; } // @property (assign, nonatomic) BOOL forNextAppLaunch; [Export ("forNextAppLaunch")] @@ -2258,21 +2193,13 @@ interface SentryTransactionContext [Export ("initWithName:operation:")] NativeHandle Constructor (string name, string operation); - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled __attribute__((deprecated("Use initWithName:operation:sampled:sampleRate:sampleRand instead"))); + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled; [Export ("initWithName:operation:sampled:")] NativeHandle Constructor (string name, string operation, SentrySampleDecision sampled); - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled sampleRate:(NSNumber * _Nullable)sampleRate sampleRand:(NSNumber * _Nullable)sampleRand; - [Export ("initWithName:operation:sampled:sampleRate:sampleRand:")] - NativeHandle Constructor (string name, string operation, SentrySampleDecision sampled, [NullAllowed] NSNumber sampleRate, [NullAllowed] NSNumber sampleRand); - - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation traceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentSpanId:(SentrySpanId * _Nullable)parentSpanId parentSampled:(SentrySampleDecision)parentSampled __attribute__((deprecated("Use initWithName:operation:traceId:spanId:parentSpanId:parentSampled:parentSampleRate:parentSampleRand instead"))); + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation traceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentSpanId:(SentrySpanId * _Nullable)parentSpanId parentSampled:(SentrySampleDecision)parentSampled; [Export ("initWithName:operation:traceId:spanId:parentSpanId:parentSampled:")] NativeHandle Constructor (string name, string operation, SentryId traceId, SentrySpanId spanId, [NullAllowed] SentrySpanId parentSpanId, SentrySampleDecision parentSampled); - - // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation traceId:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId parentSpanId:(SentrySpanId * _Nullable)parentSpanId parentSampled:(SentrySampleDecision)parentSampled parentSampleRate:(NSNumber * _Nullable)parentSampleRate parentSampleRand:(NSNumber * _Nullable)parentSampleRand; - [Export ("initWithName:operation:traceId:spanId:parentSpanId:parentSampled:parentSampleRate:parentSampleRand:")] - NativeHandle Constructor (string name, string operation, SentryId traceId, SentrySpanId spanId, [NullAllowed] SentrySpanId parentSpanId, SentrySampleDecision parentSampled, [NullAllowed] NSNumber parentSampleRate, [NullAllowed] NSNumber parentSampleRand); } // @interface SentryUser : NSObject @@ -2426,11 +2353,6 @@ interface PrivateSentrySDKOnly [Export ("getSdkVersionString")] string SdkVersionString { get; } - // +(void)addSdkPackage:(NSString * _Nonnull)name version:(NSString * _Nonnull)version; - [Static] - [Export ("addSdkPackage:version:")] - void AddSdkPackage (string name, string version); - // +(NSDictionary * _Nonnull)getExtraContext; [Static] [Export ("getExtraContext")] @@ -2497,16 +2419,6 @@ interface PrivateSentrySDKOnly [Export ("setCurrentScreen:")] void SetCurrentScreen (string screenName); - // +(UIView * _Nonnull)sessionReplayMaskingOverlay:(id _Nonnull)options; - [Static] - [Export ("sessionReplayMaskingOverlay:")] - UIView SessionReplayMaskingOverlay (SentryRedactOptions options); - - // +(void)configureSessionReplayWith:(id _Nullable)breadcrumbConverter screenshotProvider:(id _Nullable)screenshotProvider; - [Static] - [Export ("configureSessionReplayWith:screenshotProvider:")] - void ConfigureSessionReplayWith ([NullAllowed] SentryReplayBreadcrumbConverter breadcrumbConverter, [NullAllowed] SentryViewScreenshotProvider screenshotProvider); - // +(void)captureReplay; [Static] [Export ("captureReplay")] @@ -2527,25 +2439,10 @@ interface PrivateSentrySDKOnly [Export ("addReplayRedactClasses:")] void AddReplayRedactClasses (Class[] classes); - // +(void)setIgnoreContainerClass:(Class _Nonnull)containerClass; - [Static] - [Export ("setIgnoreContainerClass:")] - void SetIgnoreContainerClass (Class containerClass); - - // +(void)setRedactContainerClass:(Class _Nonnull)containerClass; - [Static] - [Export ("setRedactContainerClass:")] - void SetRedactContainerClass (Class containerClass); - - // +(void)setReplayTags:(NSDictionary * _Nonnull)tags; - [Static] - [Export ("setReplayTags:")] - void SetReplayTags (NSDictionary tags); - // +(NSDictionary * _Nullable)appStartMeasurementWithSpans; [Static] [NullAllowed, Export ("appStartMeasurementWithSpans")] - NSDictionary AppStartMeasurementWithSpans { get; } + NSDictionary AppStartMeasurementWithSpans(); // +(SentryUser * _Nonnull)userWithDictionary:(NSDictionary * _Nonnull)dictionary; [Static] @@ -2557,3 +2454,32 @@ interface PrivateSentrySDKOnly [Export ("breadcrumbWithDictionary:")] SentryBreadcrumb BreadcrumbWithDictionary (NSDictionary dictionary); } + +// @interface SentryId : NSObject +[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")] +[Internal] +interface SentryId +{ + // @property (nonatomic, strong, class) SentryId * _Nonnull empty; + [Static] + [Export ("empty", ArgumentSemantic.Strong)] + SentryId Empty { get; set; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; + [Export ("sentryIdString")] + string SentryIdString { get; } + + // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer)); + [Export ("initWithUuid:")] + [DesignatedInitializer] + NativeHandle Constructor (NSUuid uuid); + + // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer)); + [Export ("initWithUUIDString:")] + [DesignatedInitializer] + NativeHandle Constructor (string uuidString); + + // @property (readonly, nonatomic) NSUInteger hash; + [Export ("hash")] + nuint Hash { get; } +} diff --git a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj index 92164fc5ac..60364aae34 100644 --- a/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj +++ b/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj @@ -31,9 +31,7 @@ - - diff --git a/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs index 9735003cd1..7fb471de9c 100644 --- a/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/StructsAndEnums.cs @@ -66,3 +66,25 @@ internal enum SentrySpanStatus : ulong OutOfRange, DataLoss } + +[Native] +internal enum SentryLevel : ulong +{ + None = 0, + Debug = 1, + Info = 2, + Warning = 3, + Error = 4, + Fatal = 5 +} + +[Native] +internal enum SentryTransactionNameSource : long +{ + Custom = 0, + Url = 1, + Route = 2, + View = 3, + Component = 4, + Task = 5 +} diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs deleted file mode 100644 index 61fa7556a0..0000000000 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ /dev/null @@ -1,405 +0,0 @@ -/* - * This file defines iOS API contracts for the members we need from Sentry-Swift.h - * Note that we are **not** using Objective Sharpie to generate contracts (instead they're maintained manually). - */ -using System; -using Foundation; -using ObjCRuntime; -using UIKit; - -namespace Sentry.CocoaSdk; - -[BaseType(typeof(NSObject), Name = "_TtC6Sentry14SentryFeedback")] -[DisableDefaultCtor] // Marks the default constructor as unavailable -[Internal] -interface SentryFeedback -{ - [Export("name", ArgumentSemantic.Copy)] - string Name { get; set; } - - [Export("email", ArgumentSemantic.Copy)] - string Email { get; set; } - - [Export("message", ArgumentSemantic.Copy)] - string Message { get; set; } - - [Export("source")] - SentryFeedbackSource Source { get; set; } - - [Export("eventId", ArgumentSemantic.Strong)] - SentryId EventId { get; } - - [Export("associatedEventId", ArgumentSemantic.Strong)] - SentryId AssociatedEventId { get; set; } - - [Export("initWithMessage:name:email:source:associatedEventId:attachments:")] - [DesignatedInitializer] - IntPtr Constructor(string message, [NullAllowed] string name, [NullAllowed] string email, SentryFeedbackSource source, [NullAllowed] SentryId associatedEventId, [NullAllowed] NSData[] attachments); -} - -// @interface SentryId : NSObject -[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")] -[Internal] -interface SentryId -{ - // @property (nonatomic, strong, class) SentryId * _Nonnull empty; - [Static] - [Export ("empty", ArgumentSemantic.Strong)] - SentryId Empty { get; set; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString; - [Export ("sentryIdString")] - string SentryIdString { get; } - - // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer)); - [Export ("initWithUuid:")] - [DesignatedInitializer] - NativeHandle Constructor (NSUuid uuid); - - // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer)); - [Export ("initWithUUIDString:")] - [DesignatedInitializer] - NativeHandle Constructor (string uuidString); - - // @property (readonly, nonatomic) NSUInteger hash; - [Export ("hash")] - nuint Hash { get; } -} - -// @interface SentrySessionReplayIntegration : SentryBaseIntegration -[BaseType (typeof(NSObject))] -[Internal] -interface SentrySessionReplayIntegration -{ - // -(instancetype _Nonnull)initForManualUse:(SentryOptions * _Nonnull)options; - [Export ("initForManualUse:")] - NativeHandle Constructor (SentryOptions options); - // -(BOOL)captureReplay; - [Export ("captureReplay")] - bool CaptureReplay(); - // -(void)configureReplayWith:(id _Nullable)breadcrumbConverter screenshotProvider:(id _Nullable)screenshotProvider; - [Export ("configureReplayWith:screenshotProvider:")] - void ConfigureReplayWith ([NullAllowed] SentryReplayBreadcrumbConverter breadcrumbConverter, [NullAllowed] SentryViewScreenshotProvider screenshotProvider); - // -(void)pause; - [Export ("pause")] - void Pause (); - // -(void)resume; - [Export ("resume")] - void Resume (); - // -(void)stop; - [Export ("stop")] - void Stop (); - // -(void)start; - [Export ("start")] - void Start (); - // +(id _Nonnull)createBreadcrumbwithTimestamp:(NSDate * _Nonnull)timestamp category:(NSString * _Nonnull)category message:(NSString * _Nullable)message level:(enum SentryLevel)level data:(NSDictionary * _Nullable)data; - [Static] - [Export ("createBreadcrumbwithTimestamp:category:message:level:data:")] - SentryRRWebEvent CreateBreadcrumbwithTimestamp (NSDate timestamp, string category, [NullAllowed] string message, SentryLevel level, [NullAllowed] NSDictionary data); - // +(id _Nonnull)createNetworkBreadcrumbWithTimestamp:(NSDate * _Nonnull)timestamp endTimestamp:(NSDate * _Nonnull)endTimestamp operation:(NSString * _Nonnull)operation description:(NSString * _Nonnull)description data:(NSDictionary * _Nonnull)data; - [Static] - [Export ("createNetworkBreadcrumbWithTimestamp:endTimestamp:operation:description:data:")] - SentryRRWebEvent CreateNetworkBreadcrumbWithTimestamp (NSDate timestamp, NSDate endTimestamp, string operation, string description, NSDictionary data); - // +(id _Nonnull)createDefaultBreadcrumbConverter; - [Static] - [Export ("createDefaultBreadcrumbConverter")] - SentryReplayBreadcrumbConverter CreateDefaultBreadcrumbConverter(); -} - -[Protocol(Name = "_TtP6Sentry19SentryRedactOptions_")] -[Model] -[BaseType(typeof(NSObject))] -[Internal] -internal interface SentryRedactOptions -{ - [Abstract] - [Export("maskAllText")] - bool MaskAllText { get; } - - [Abstract] - [Export("maskAllImages")] - bool MaskAllImages { get; } - - [Abstract] - [Export("maskedViewClasses", ArgumentSemantic.Copy)] - Class[] MaskedViewClasses { get; } - - [Abstract] - [Export("unmaskedViewClasses", ArgumentSemantic.Copy)] - Class[] UnmaskedViewClasses { get; } -} - -// @protocol SentryReplayBreadcrumbConverter -[Protocol (Name = "_TtP6Sentry31SentryReplayBreadcrumbConverter_")] -[BaseType (typeof(NSObject), Name = "_TtP6Sentry31SentryReplayBreadcrumbConverter_")] -[Model] -[Internal] -interface SentryReplayBreadcrumbConverter -{ - // @required -(id _Nullable)convertFrom:(SentryBreadcrumb * _Nonnull)breadcrumb __attribute__((warn_unused_result(""))); - [Abstract] - [Export ("convertFrom:")] - [return: NullAllowed] - SentryRRWebEvent ConvertFrom (SentryBreadcrumb breadcrumb); -} - -// @interface SentryReplayOptions : NSObject -[BaseType (typeof(NSObject), Name = "_TtC6Sentry19SentryReplayOptions")] -[Internal] -interface SentryReplayOptions //: ISentryRedactOptions -{ - // @property (nonatomic) float sessionSampleRate; - [Export ("sessionSampleRate")] - float SessionSampleRate { get; set; } - // @property (nonatomic) float onErrorSampleRate; - [Export ("onErrorSampleRate")] - float OnErrorSampleRate { get; set; } - // @property (nonatomic) BOOL maskAllText; - [Export ("maskAllText")] - bool MaskAllText { get; set; } - // @property (nonatomic) BOOL maskAllImages; - [Export ("maskAllImages")] - bool MaskAllImages { get; set; } - // @property (nonatomic) enum SentryReplayQuality quality; - [Export ("quality", ArgumentSemantic.Assign)] - SentryReplayQuality Quality { 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; } - // @property (readonly, nonatomic) NSInteger replayBitRate; - [Export ("replayBitRate")] - nint ReplayBitRate { get; } - // @property (readonly, nonatomic) float sizeScale; - [Export ("sizeScale")] - float SizeScale { get; } - // @property (nonatomic) NSUInteger frameRate; - [Export ("frameRate")] - nuint FrameRate { get; set; } - // @property (readonly, nonatomic) NSTimeInterval errorReplayDuration; - [Export ("errorReplayDuration")] - double ErrorReplayDuration { get; } - // @property (readonly, nonatomic) NSTimeInterval sessionSegmentDuration; - [Export ("sessionSegmentDuration")] - double SessionSegmentDuration { get; } - // @property (readonly, nonatomic) NSTimeInterval maximumDuration; - [Export ("maximumDuration")] - double MaximumDuration { get; } - // -(instancetype _Nonnull)initWithSessionSampleRate:(float)sessionSampleRate onErrorSampleRate:(float)onErrorSampleRate maskAllText:(BOOL)maskAllText maskAllImages:(BOOL)maskAllImages __attribute__((objc_designated_initializer)); - [Export ("initWithSessionSampleRate:onErrorSampleRate:maskAllText:maskAllImages:")] - [DesignatedInitializer] - NativeHandle Constructor (float sessionSampleRate, float onErrorSampleRate, bool maskAllText, bool maskAllImages); - // -(instancetype _Nonnull)initWithDictionary:(NSDictionary * _Nonnull)dictionary; - [Export ("initWithDictionary:")] - NativeHandle Constructor (NSDictionary dictionary); - */ -} - -// @interface SentryRRWebEvent : NSObject -[BaseType (typeof(NSObject), Name = "_TtC6Sentry16SentryRRWebEvent")] -[Protocol] -[Model] -[DisableDefaultCtor] -[Internal] -interface SentryRRWebEvent : SentrySerializable -{ - // @property (readonly, nonatomic) enum SentryRRWebEventType type; - [Export ("type")] - SentryRRWebEventType Type { get; } - // @property (readonly, copy, nonatomic) NSDate * _Nonnull timestamp; - [Export ("timestamp", ArgumentSemantic.Copy)] - NSDate Timestamp { get; } - // @property (readonly, copy, nonatomic) NSDictionary * _Nullable data; - [NullAllowed, Export ("data", ArgumentSemantic.Copy)] - NSDictionary Data { get; } - // -(instancetype _Nonnull)initWithType:(enum SentryRRWebEventType)type timestamp:(NSDate * _Nonnull)timestamp data:(NSDictionary * _Nullable)data __attribute__((objc_designated_initializer)); - [Export ("initWithType:timestamp:data:")] - [DesignatedInitializer] - NativeHandle Constructor (SentryRRWebEventType type, NSDate timestamp, [NullAllowed] NSDictionary data); - // -(NSDictionary * _Nonnull)serialize __attribute__((warn_unused_result(""))); - [Export ("serialize")] - new NSDictionary Serialize(); -} - -[BaseType(typeof(NSObject), Name = "_TtC6Sentry31SentryUserFeedbackConfiguration")] -[DisableDefaultCtor] -[Internal] -interface SentryUserFeedbackConfiguration -{ - [Export("animations")] - bool Animations { get; set; } - - [NullAllowed, Export("configureWidget", ArgumentSemantic.Copy)] - Action ConfigureWidget { get; set; } - - [Export("widgetConfig", ArgumentSemantic.Strong)] - SentryUserFeedbackWidgetConfiguration WidgetConfig { get; set; } - - [Export("useShakeGesture")] - bool UseShakeGesture { get; set; } - - [Export("showFormForScreenshots")] - bool ShowFormForScreenshots { get; set; } - - // [NullAllowed, Export("configureForm", ArgumentSemantic.Copy)] - // Action ConfigureForm { get; set; } - - // [Export("formConfig", ArgumentSemantic.Strong)] - // SentryUserFeedbackFormConfiguration FormConfig { get; set; } - - [NullAllowed, Export("tags", ArgumentSemantic.Copy)] - NSDictionary Tags { get; set; } - - [NullAllowed, Export("onFormOpen", ArgumentSemantic.Copy)] - Action OnFormOpen { get; set; } - - [NullAllowed, Export("onFormClose", ArgumentSemantic.Copy)] - Action OnFormClose { get; set; } - - [NullAllowed, Export("onSubmitSuccess", ArgumentSemantic.Copy)] - Action> OnSubmitSuccess { get; set; } - - [NullAllowed, Export("onSubmitError", ArgumentSemantic.Copy)] - Action OnSubmitError { get; set; } - - // [NullAllowed, Export("configureTheme", ArgumentSemantic.Copy)] - // Action ConfigureTheme { get; set; } - // - // [Export("theme", ArgumentSemantic.Strong)] - // SentryUserFeedbackThemeConfiguration Theme { get; set; } - // - // [NullAllowed, Export("configureDarkTheme", ArgumentSemantic.Copy)] - // Action ConfigureDarkTheme { get; set; } - // - // [Export("darkTheme", ArgumentSemantic.Strong)] - // SentryUserFeedbackThemeConfiguration DarkTheme { get; set; } - - [Export("textEffectiveHeightCenter")] - nfloat TextEffectiveHeightCenter { get; set; } - - [Export("scaleFactor")] - nfloat ScaleFactor { get; set; } - - [Export("calculateScaleFactor")] - nfloat CalculateScaleFactor(); - - [Export("paddingScaleFactor")] - nfloat PaddingScaleFactor { get; set; } - - [Export("calculatePaddingScaleFactor")] - nfloat CalculatePaddingScaleFactor(); - - [Export("recalculateScaleFactors")] - void RecalculateScaleFactors(); - - [Export("padding")] - nfloat Padding { get; } - - [Export("spacing")] - nfloat Spacing { get; } - - [Export("margin")] - nfloat Margin { get; } - - [Export("init")] - [DesignatedInitializer] - IntPtr Constructor(); -} - -// [BaseType(typeof(NSObject), Name = "_TtC6Sentry37SentryUserFeedbackThemeConfiguration")] -// [DisableDefaultCtor] -// [Internal] -// interface SentryUserFeedbackThemeConfiguration -// { -// [Export("backgroundColor", ArgumentSemantic.Strong)] -// UIColor BackgroundColor { get; set; } -// -// [Export("textColor", ArgumentSemantic.Strong)] -// UIColor TextColor { get; set; } -// -// [Export("buttonColor", ArgumentSemantic.Strong)] -// UIColor ButtonColor { get; set; } -// -// [Export("buttonTextColor", ArgumentSemantic.Strong)] -// UIColor ButtonTextColor { get; set; } -// -// [Export("init")] -// [DesignatedInitializer] -// IntPtr Constructor(); -// } - -[BaseType(typeof(NSObject), Name = "_TtC6Sentry37SentryUserFeedbackWidgetConfiguration")] -[DisableDefaultCtor] -[Internal] -interface SentryUserFeedbackWidgetConfiguration -{ - [Export("autoInject")] - bool AutoInject { get; set; } - - [Export("defaultLabelText", ArgumentSemantic.Copy)] - string DefaultLabelText { get; } - - [NullAllowed, Export("labelText", ArgumentSemantic.Copy)] - string LabelText { get; set; } - - [Export("showIcon")] - bool ShowIcon { get; set; } - - [NullAllowed, Export("widgetAccessibilityLabel", ArgumentSemantic.Copy)] - string WidgetAccessibilityLabel { get; set; } - - [Export("windowLevel")] - nfloat WindowLevel { get; set; } - - [Export("location")] - NSDirectionalRectEdge Location { get; set; } - - [Export("layoutUIOffset")] - UIOffset LayoutUIOffset { get; set; } - - [Export("init")] - [DesignatedInitializer] - IntPtr Constructor(); -} - - -// [BaseType(typeof(NSObject), Name = "_TtC6Sentry37SentryUserFeedbackFormConfiguration")] -// [DisableDefaultCtor] -// [Internal] -// interface SentryUserFeedbackFormConfiguration -// { -// [Export("title", ArgumentSemantic.Copy)] -// string Title { get; set; } -// -// [Export("subtitle", ArgumentSemantic.Copy)] -// string Subtitle { get; set; } -// -// [Export("submitButtonTitle", ArgumentSemantic.Copy)] -// string SubmitButtonTitle { get; set; } -// -// [Export("cancelButtonTitle", ArgumentSemantic.Copy)] -// string CancelButtonTitle { get; set; } -// -// [Export("thankYouMessage", ArgumentSemantic.Copy)] -// string ThankYouMessage { get; set; } -// -// [Export("init")] -// [DesignatedInitializer] -// IntPtr Constructor(); -// } - -// @protocol SentryViewScreenshotProvider -[Protocol (Name = "_TtP6Sentry28SentryViewScreenshotProvider_")] -[Model] -[BaseType (typeof(NSObject), Name = "_TtP6Sentry28SentryViewScreenshotProvider_")] -[Internal] -interface SentryViewScreenshotProvider -{ - // @required -(void)imageWithView:(UIView * _Nonnull)view onComplete:(void (^ _Nonnull)(UIImage * _Nonnull))onComplete; - [Abstract] - [Export ("imageWithView:onComplete:")] - void OnComplete (UIView view, Action onComplete); -} diff --git a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs deleted file mode 100644 index efd86efee2..0000000000 --- a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file defines iOS API contracts for enums we need from Sentry-Swift.h. - * Note that we are **not** using Objective Sharpie to generate these contracts (instead they're maintained manually). - */ -using System.Runtime.InteropServices; -using Foundation; -using ObjCRuntime; -using Sentry; - -namespace Sentry.CocoaSdk; - -[Native] -internal enum SentryFeedbackSource : long -{ - Unknown = 0, - User = 1, - System = 2, - Other = 3 -} - -[Native] -internal enum SentryLevel : ulong -{ - None = 0, - Debug = 1, - Info = 2, - Warning = 3, - Error = 4, - Fatal = 5 -} - -[Native] -internal enum SentryReplayQuality : long -{ - Low = 0, - Medium = 1, - High = 2 -} - -[Native] -internal enum SentryReplayType : long -{ - Session = 0, - Buffer = 1 -} - -[Native] -internal enum SentryRRWebEventType : long -{ - None = 0, - Touch = 3, - Meta = 4, - Custom = 5 -} - -[Native] -internal enum SentryTransactionNameSource : long -{ - Custom = 0, - Url = 1, - Route = 2, - View = 3, - Component = 4, - Task = 5 -} From c782c6a41ccbb86b3d8783e83d7bd010b87bc1b0 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 20 May 2025 10:59:31 +1200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23385ed7ae..b65eee8e28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ - .NET MAUI integration with CommunityToolkit.Mvvm Async Relay Commands can now be auto spanned with the new package Sentry.Maui.CommunityToolkit.Mvvm ([#4125](https://github.com/getsentry/sentry-dotnet/pull/4125)) +### Fixes + +- Revert "Bump Cocoa SDK from v8.39.0 to v8.46.0 (#4103)" ([#4202](https://github.com/getsentry/sentry-dotnet/pull/4202)) + - IMPORTANT: Fixes multiple issues running versions 5.6.x and 5.7.x of the Sentry SDK for .NET on iOS (initialising the SDK and sending data to Sentry) + ### Dependencies - Bump Native SDK from v0.8.4 to v0.8.5 ([#4189](https://github.com/getsentry/sentry-dotnet/pull/4189))