diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index 9d8498fef2..f3c920b1e0 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.46.0 +version = 8.53.2 repo = https://github.com/getsentry/sentry-cocoa diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 90b3d76a51..d06ebea472 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -96,6 +96,8 @@ Write-Output "iPhoneSdkVersion: $iPhoneSdkVersion" ## Imports in the various header files are provided in the "new" style of: # `#import ` +# ...or: +# `#import SENTRY_HEADER(SentryHeader)` # ...instead of: # `#import "SomeHeader.h"` # This causes sharpie to fail resolve those headers @@ -106,6 +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"' Set-Content -Path $file -Value $content } else @@ -206,7 +209,7 @@ $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, 0\)\]\n?', '' +$Text = $Text -replace '\[iOS \(13,\s?0\)\]\n?', '' # Fix delegate argument names $Text = $Text -replace '(NSError) arg\d', '$1 error' diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index cf38a5e4b4..3b563d3c4f 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -384,7 +384,7 @@ interface SentryDsn [Export ("getHash")] string Hash { get; } - // -(NSURL * _Nonnull)getStoreEndpoint; + // -(NSURL * _Nonnull)getStoreEndpoint __attribute__((deprecated("This endpoint is no longer used"))); [Export ("getStoreEndpoint")] NSUrl StoreEndpoint { get; } @@ -412,6 +412,10 @@ interface SentryEnvelopeItemHeader : SentrySerializable [Export ("initWithType:length:filenname:contentType:")] NativeHandle Constructor (string type, nuint length, string filename, string contentType); + // -(instancetype _Nonnull)initWithType:(NSString * _Nonnull)type length:(NSUInteger)length contentType:(NSString * _Nonnull)contentType itemCount:(NSNumber * _Nonnull)itemCount; + [Export ("initWithType:length:contentType:itemCount:")] + NativeHandle Constructor (string type, nuint length, string contentType, NSNumber itemCount); + // @property (readonly, copy, nonatomic) NSString * _Nonnull type; [Export ("type")] string Type { get; } @@ -427,6 +431,14 @@ interface SentryEnvelopeItemHeader : SentrySerializable // @property (readonly, copy, nonatomic) NSString * _Nullable contentType; [NullAllowed, Export ("contentType")] string ContentType { get; } + + // @property (readonly, copy, nonatomic) NSNumber * _Nullable itemCount; + [NullAllowed, Export ("itemCount", ArgumentSemantic.Copy)] + NSNumber ItemCount { get; } + + // @property (copy, nonatomic) NSString * _Nullable platform; + [NullAllowed, Export ("platform")] + string Platform { get; set; } } partial interface Constants @@ -559,13 +571,6 @@ interface SentryEvent : SentrySerializable NativeHandle Constructor (NSError error); } -// @interface SentryEventDecodable : SentryEvent -[BaseType (typeof(SentryEvent))] -[Internal] -interface SentryEventDecodable -{ -} - // @interface SentryException : NSObject [BaseType (typeof(NSObject))] [DisableDefaultCtor] @@ -601,6 +606,20 @@ interface SentryException : SentrySerializable NativeHandle Constructor (string value, string type); } +// @interface SentryFeedbackAPI : NSObject +[BaseType (typeof(NSObject))] +[Internal] +interface SentryFeedbackAPI +{ + // -(void)showWidget __attribute__((availability(ios, introduced=13.0))); + [Export ("showWidget")] + void ShowWidget (); + + // -(void)hideWidget __attribute__((availability(ios, introduced=13.0))); + [Export ("hideWidget")] + void HideWidget (); +} + // @interface SentryFrame : NSObject [BaseType (typeof(NSObject))] [Internal] @@ -1024,6 +1043,23 @@ interface SentryHub void Close (); } +// @protocol SentryIntegrationProtocol +[Protocol] +[BaseType (typeof(NSObject))] +[Internal] +interface SentryIntegrationProtocol +{ + // @required -(BOOL)installWithOptions:(SentryOptions * _Nonnull)options __attribute__((swift_name("install(with:)"))); + [Abstract] + [Export ("installWithOptions:")] + bool InstallWithOptions (SentryOptions options); + + // @required -(void)uninstall; + [Abstract] + [Export ("uninstall")] + void Uninstall (); +} + // @interface SentryMeasurementUnit : NSObject [BaseType (typeof(NSObject))] [DisableDefaultCtor] @@ -1522,6 +1558,10 @@ interface SentryOptions [Export ("enableCoreDataTracing")] bool EnableCoreDataTracing { get; set; } + // @property (copy, nonatomic) SentryProfilingConfigurationBlock _Nullable configureProfiling; + [NullAllowed, Export ("configureProfiling", ArgumentSemantic.Copy)] + SentryProfilingConfigurationBlock ConfigureProfiling { get; set; } + // @property (assign, nonatomic) BOOL enableAppLaunchProfiling; [Export ("enableAppLaunchProfiling")] bool EnableAppLaunchProfiling { get; set; } @@ -1605,11 +1645,19 @@ interface SentryOptions [Export ("spotlightUrl")] string SpotlightUrl { get; set; } + // @property (readonly, nonatomic) NSObject * _Nonnull _swiftExperimentalOptions; + [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)] SentryUserFeedbackConfigurationBlock ConfigureUserFeedback { get; set; } } +// typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions * _Nonnull); +[Internal] +delegate void SentryProfilingConfigurationBlock (SentryProfileOptions arg0); + // @interface SentryReplayApi : NSObject [BaseType (typeof(NSObject))] [Internal] @@ -1817,6 +1865,11 @@ interface SentrySDK [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:")] @@ -2325,33 +2378,6 @@ interface SentryUser : SentrySerializable nuint Hash { get; } } -// @interface SentryUserFeedback : NSObject -[BaseType (typeof(NSObject))] -[DisableDefaultCtor] -[Internal] -interface SentryUserFeedback : SentrySerializable -{ - // -(instancetype _Nonnull)initWithEventId:(SentryId * _Nonnull)eventId; - [Export ("initWithEventId:")] - NativeHandle Constructor (SentryId eventId); - - // @property (readonly, nonatomic, strong) SentryId * _Nonnull eventId; - [Export ("eventId", ArgumentSemantic.Strong)] - SentryId EventId { get; } - - // @property (copy, nonatomic) NSString * _Nonnull name; - [Export ("name")] - string Name { get; set; } - - // @property (copy, nonatomic) NSString * _Nonnull email; - [Export ("email")] - string Email { get; set; } - - // @property (copy, nonatomic) NSString * _Nonnull comments; - [Export ("comments")] - string Comments { get; set; } -} - // @interface SentryScreenFrames : NSObject [BaseType (typeof(NSObject))] [DisableDefaultCtor] @@ -2436,6 +2462,11 @@ interface PrivateSentrySDKOnly [Export ("getExtraContext")] NSDictionary ExtraContext { get; } + // +(void)setTrace:(SentryId * _Nonnull)traceId spanId:(SentrySpanId * _Nonnull)spanId; + [Static] + [Export ("setTrace:spanId:")] + void SetTrace (SentryId traceId, SentrySpanId spanId); + // +(uint64_t)startProfilerForTrace:(SentryId * _Nonnull)traceId; [Static] [Export ("startProfilerForTrace:")] diff --git a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs index 61fa7556a0..77c2373975 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs @@ -66,6 +66,30 @@ interface SentryId nuint Hash { get; } } +// @interface SentryProfileOptions : NSObject +[BaseType(typeof(NSObject), Name = "_TtC6Sentry20SentryProfileOptions")] +[DisableDefaultCtor] +[Internal] +interface SentryProfileOptions +{ + // @property(nonatomic) enum SentryProfileLifecycle lifecycle; + [Export("lifecycle", ArgumentSemantic.Assign)] + SentryProfileLifecycle Lifecycle { get; set; } + + // @property(nonatomic) float sessionSampleRate; + [Export("sessionSampleRate")] + float SessionSampleRate { get; set; } + + // @property(nonatomic) BOOL profileAppStarts; + [Export("profileAppStarts")] + bool ProfileAppStarts { get; set; } + + // - (nonnull instancetype) init OBJC_DESIGNATED_INITIALIZER; + [Export("init")] + [DesignatedInitializer] + NativeHandle Constructor(); +} + // @interface SentrySessionReplayIntegration : SentryBaseIntegration [BaseType (typeof(NSObject))] [Internal] @@ -224,6 +248,33 @@ interface SentryRRWebEvent : SentrySerializable new NSDictionary Serialize(); } +// @interface SentryUserFeedback : NSObject +[BaseType(typeof(NSObject))] +[DisableDefaultCtor] +[Internal] +interface SentryUserFeedback : SentrySerializable +{ + // @property (nonatomic, readonly, strong) SentryId * _Nonnull eventId; + [Export("eventId", ArgumentSemantic.Strong)] + SentryId EventId { get; } + + // @property (nonatomic, copy) NSString * _Nonnull name; + [Export("name")] + string Name { get; set; } + + // @property (nonatomic, copy) NSString * _Nonnull email; + [Export("email")] + string Email { get; set; } + + // @property (nonatomic, copy) NSString * _Nonnull comments; + [Export("comments")] + string Comments { get; set; } + + // - (nonnull instancetype)initWithEventId:(SentryId * _Nonnull)eventId OBJC_DESIGNATED_INITIALIZER; + [Export("initWithEventId:")] + NativeHandle Constructor(SentryId eventId); +} + [BaseType(typeof(NSObject), Name = "_TtC6Sentry31SentryUserFeedbackConfiguration")] [DisableDefaultCtor] [Internal] diff --git a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs index efd86efee2..5cc5cc81c7 100644 --- a/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs +++ b/src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs @@ -29,6 +29,13 @@ internal enum SentryLevel : ulong Fatal = 5 } +[Native] +internal enum SentryProfileLifecycle : long +{ + Manual = 0, + Trace = 1 +} + [Native] internal enum SentryReplayQuality : long {