Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bump cocoa to 8.46.0
  • Loading branch information
jamescrosswell committed Apr 10, 2025
commit b3d0db3ea13bfdf2963c83ffd63c91874bc3237b
2 changes: 1 addition & 1 deletion modules/sentry-cocoa.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 8.44.0
version = 8.46.0
repo = https://github.com/getsentry/sentry-cocoa
17 changes: 17 additions & 0 deletions scripts/generate-cocoa-bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ $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
$SentryFeedbackSource = @'
[Native]
internal enum SentryFeedbackSource : long
{
Unknown = 0,
User = 1,
System = 2,
Other = 3
}
'@

# 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 = @'
Expand Down Expand Up @@ -185,6 +198,7 @@ internal enum SentryRRWebEventType : long
}
'@

$Text += "`n$SentryFeedbackSource"
$Text += "`n$SentryLevel"
$Text += "`n$SentryTransactionNameSource"
$Text += "`n$SentryReplayQuality"
Expand Down Expand Up @@ -221,6 +235,9 @@ $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 \(\d{1,2}, \d{1,2}\)\]\n?', ''

# Fix delegate argument names
$Text = $Text -replace '(NSError) arg\d', '$1 error'
$Text = $Text -replace '(NSHttpUrlResponse) arg\d', '$1 response'
Expand Down
107 changes: 96 additions & 11 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ namespace Sentry.CocoaSdk;
[return: NullAllowed]
delegate NSNumber SentryTracesSamplerCallback (SentrySamplingContext samplingContext);

// typedef void (^SentrySpanCallback)(id<SentrySpan> _Nullable);
// typedef void (^SentrySpanCallback)(DEPRECATED_MSG_ATTRIBUTE("See `SentryScope.useSpan` for reasoning of deprecation.") id<SentrySpan>);
[Internal]
delegate void SentrySpanCallback ([NullAllowed] SentrySpan span);
delegate void SentrySpanCallback (SentrySpan span);

// typedef void (^SentryUserFeedbackConfigurationBlock)(SentryUserFeedbackConfiguration * _Nonnull);
[Internal]
delegate void SentryUserFeedbackConfigurationBlock (SentryUserFeedbackConfiguration arg0);

// @interface SentryAttachment : NSObject
[BaseType (typeof(NSObject))]
Expand Down Expand Up @@ -135,6 +139,10 @@ 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; }
Expand All @@ -151,6 +159,10 @@ 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);
Expand Down Expand Up @@ -195,6 +207,10 @@ 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<NSString *,id> * _Nullable data;
[NullAllowed, Export ("data", ArgumentSemantic.Strong)]
NSDictionary<NSString, NSObject> Data { get; set; }
Expand Down Expand Up @@ -266,10 +282,14 @@ interface SentryClient
[Export ("captureMessage:withScope:")]
SentryId CaptureMessage (string message, SentryScope scope);

// -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)")));
// -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))) __attribute__((deprecated("Use -[SentryClient captureFeedback:withScope:].")));
[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);
Expand Down Expand Up @@ -539,6 +559,13 @@ interface SentryEvent : SentrySerializable
NativeHandle Constructor (NSError error);
}

// @interface SentryEventDecodable : SentryEvent
[BaseType (typeof(SentryEvent))]
[Internal]
interface SentryEventDecodable
{
}

// @interface SentryException : NSObject <SentrySerializable>
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -944,10 +971,14 @@ interface SentryHub
[Export ("captureMessage:withScope:")]
SentryId CaptureMessage (string message, SentryScope scope);

// -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)")));
// -(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)"))) __attribute__((deprecated("Use -[SentryHub captureFeedback:].")));
[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<SentryScope> callback);
Expand Down Expand Up @@ -1573,6 +1604,10 @@ 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
Expand Down Expand Up @@ -1603,6 +1638,18 @@ 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 <SentrySerializable>
Expand Down Expand Up @@ -1760,11 +1807,16 @@ interface SentrySDK
[Export ("captureMessage:withScopeBlock:")]
SentryId CaptureMessage (string message, Action<SentryScope> block);

// +(void)captureUserFeedback:(SentryUserFeedback * _Nonnull)userFeedback __attribute__((swift_name("capture(userFeedback:)")));
// +(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);

// +(void)addBreadcrumb:(SentryBreadcrumb * _Nonnull)crumb __attribute__((swift_name("addBreadcrumb(_:)")));
[Static]
[Export ("addBreadcrumb:")]
Expand Down Expand Up @@ -1973,7 +2025,7 @@ partial interface SentryScope : SentrySerializable
[Export ("clear")]
void Clear ();

// -(void)useSpan:(SentrySpanCallback _Nonnull)callback;
// -(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.")));
[Export ("useSpan:")]
void UseSpan (SentrySpanCallback callback);
}
Expand Down Expand Up @@ -2096,6 +2148,10 @@ 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; }
Expand All @@ -2108,6 +2164,10 @@ 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);
Expand Down Expand Up @@ -2170,13 +2230,25 @@ 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 sampleRate;
[NullAllowed, Export ("sampleRate", ArgumentSemantic.Strong)]
NSNumber SampleRate { 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 (assign, nonatomic) BOOL forNextAppLaunch;
[Export ("forNextAppLaunch")]
Expand All @@ -2186,13 +2258,21 @@ interface SentryTransactionContext
[Export ("initWithName:operation:")]
NativeHandle Constructor (string name, string operation);

// -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled;
// -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name operation:(NSString * _Nonnull)operation sampled:(SentrySampleDecision)sampled __attribute__((deprecated("Use initWithName:operation:sampled:sampleRate:sampleRand instead")));
[Export ("initWithName:operation:sampled:")]
NativeHandle Constructor (string name, string operation, SentrySampleDecision sampled);

// -(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;
// -(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")));
[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 <SentrySerializable, NSCopying>
Expand Down Expand Up @@ -2417,6 +2497,11 @@ interface PrivateSentrySDKOnly
[Export ("setCurrentScreen:")]
void SetCurrentScreen (string screenName);

// +(UIView * _Nonnull)sessionReplayMaskingOverlay:(id<SentryRedactOptions> _Nonnull)options;
[Static]
[Export ("sessionReplayMaskingOverlay:")]
UIView SessionReplayMaskingOverlay (SentryRedactOptions options);

// +(void)configureSessionReplayWith:(id<SentryReplayBreadcrumbConverter> _Nullable)breadcrumbConverter screenshotProvider:(id<SentryViewScreenshotProvider> _Nullable)screenshotProvider;
[Static]
[Export ("configureSessionReplayWith:screenshotProvider:")]
Expand Down
1 change: 1 addition & 0 deletions src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<!-- Set up the binding project. -->
<ObjcBindingApiDefinition Include="ApiDefinitions.cs" />
<ObjcBindingApiDefinition Include="PrivateApiDefinitions.cs" />
<ObjcBindingApiDefinition Include="SwiftApiDefinitions.cs" />
<ObjcBindingCoreSource Include="StructsAndEnums.cs" />
<NativeReference Include="$(SentryCocoaFramework)" Kind="Framework" />

Expand Down
8 changes: 8 additions & 0 deletions src/Sentry.Bindings.Cocoa/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ internal enum SentrySpanStatus : ulong
OutOfRange,
DataLoss
}
[Native]
internal enum SentryFeedbackSource : long
{
Unknown = 0,
User = 1,
System = 2,
Other = 3
}

[Native]
internal enum SentryLevel : ulong
Expand Down
Loading