Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
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.46.0
version = 8.53.2
repo = https://github.com/getsentry/sentry-cocoa
5 changes: 4 additions & 1 deletion scripts/generate-cocoa-bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Write-Output "iPhoneSdkVersion: $iPhoneSdkVersion"

## Imports in the various header files are provided in the "new" style of:
# `#import <Sentry/SomeHeader.h>`
# ...or:
# `#import SENTRY_HEADER(SentryHeader)`
# ...instead of:
# `#import "SomeHeader.h"`
# This causes sharpie to fail resolve those headers
Expand All @@ -106,6 +108,7 @@ foreach ($file in $filesToPatch)
{
$content = Get-Content -Path $file -Raw
$content = $content -replace '<Sentry/([^>]+)>', '"$1"'
$content = $content -replace '#import SENTRY_HEADER\(([^)]+)\)', '#import "$1.h"'
Set-Content -Path $file -Value $content
}
else
Expand Down Expand Up @@ -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'
Expand Down
101 changes: 66 additions & 35 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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; }
Expand All @@ -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
Expand Down Expand Up @@ -559,13 +571,6 @@ 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 @@ -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 <SentrySerializable>
[BaseType (typeof(NSObject))]
[Internal]
Expand Down Expand Up @@ -1024,6 +1043,23 @@ interface SentryHub
void Close ();
}

// @protocol SentryIntegrationProtocol <NSObject>
[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 <NSCopying>
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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:")]
Expand Down Expand Up @@ -2325,33 +2378,6 @@ interface SentryUser : SentrySerializable
nuint Hash { get; }
}

// @interface SentryUserFeedback : NSObject <SentrySerializable>
[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 <NSCopying>
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -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:")]
Expand Down
51 changes: 51 additions & 0 deletions src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -224,6 +248,33 @@ interface SentryRRWebEvent : SentrySerializable
new NSDictionary<NSString, NSObject> Serialize();
}

// @interface SentryUserFeedback : NSObject <SentrySerializable>
[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]
Expand Down
7 changes: 7 additions & 0 deletions src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ internal enum SentryLevel : ulong
Fatal = 5
}

[Native]
internal enum SentryProfileLifecycle : long
{
Manual = 0,
Trace = 1
}

[Native]
internal enum SentryReplayQuality : long
{
Expand Down
Loading