Skip to content

Commit 4e64ad2

Browse files
Update Sentry Cocoa SDK to 7.24.1 (#1912)
1 parent bc83877 commit 4e64ad2

File tree

7 files changed

+63
-23
lines changed

7 files changed

+63
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- `SentryOptions.AttachStackTrace` is now enabled by default. ([#1907](https://github.com/getsentry/sentry-dotnet/pull/1907))
88
- Update Sentry Android SDK to version 6.4.1 ([#1911](https://github.com/getsentry/sentry-dotnet/pull/1911))
9+
- Update Sentry Cocoa SDK to version 7.24.1 ([#1912](https://github.com/getsentry/sentry-dotnet/pull/1912))
910

1011
## 3.21.0
1112

src/Sentry/Platforms/iOS/Bindings/ApiDefinitions.cs

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ interface SentryOptions
813813
[Export ("enabled")]
814814
bool Enabled { get; set; }
815815

816+
// @property (assign, nonatomic) BOOL enableCrashHandler;
817+
[Export ("enableCrashHandler")]
818+
bool EnableCrashHandler { get; set; }
819+
816820
// @property (assign, nonatomic) NSUInteger maxBreadcrumbs;
817821
[Export ("maxBreadcrumbs")]
818822
nuint MaxBreadcrumbs { get; set; }
@@ -894,6 +898,10 @@ interface SentryOptions
894898
[Export ("attachScreenshot")]
895899
bool AttachScreenshot { get; set; }
896900

901+
// @property (assign, nonatomic) BOOL attachViewHierarchy;
902+
[Export ("attachViewHierarchy")]
903+
bool AttachViewHierarchy { get; set; }
904+
897905
// @property (assign, nonatomic) BOOL enableUserInteractionTracing;
898906
[Export ("enableUserInteractionTracing")]
899907
bool EnableUserInteractionTracing { get; set; }
@@ -954,7 +962,19 @@ interface SentryOptions
954962
[Export ("enableCoreDataTracking")]
955963
bool EnableCoreDataTracking { get; set; }
956964

957-
// @property (assign, nonatomic) BOOL enableProfiling;
965+
// @property (nonatomic, strong) NSNumber * _Nullable profilesSampleRate;
966+
[NullAllowed, Export ("profilesSampleRate", ArgumentSemantic.Strong)]
967+
NSNumber ProfilesSampleRate { get; set; }
968+
969+
// @property (nonatomic) SentryTracesSamplerCallback _Nullable profilesSampler;
970+
[NullAllowed, Export ("profilesSampler", ArgumentSemantic.Assign)]
971+
Func<SentrySamplingContext, NSNumber?> ProfilesSampler { get; set; }
972+
973+
// @property (readonly, assign, nonatomic) BOOL isProfilingEnabled;
974+
[Export ("isProfilingEnabled")]
975+
bool IsProfilingEnabled { get; }
976+
977+
// @property (assign, nonatomic) BOOL enableProfiling __attribute__((deprecated("Use profilesSampleRate or profilesSampler instead. This property will be removed in a future version of the SDK")));
958978
[Export ("enableProfiling")]
959979
bool EnableProfiling { get; set; }
960980

@@ -981,10 +1001,10 @@ interface SentryOptions
9811001
[Internal]
9821002
interface SentryIntegrationProtocol
9831003
{
984-
// @required -(void)installWithOptions:(SentryOptions * _Nonnull)options;
1004+
// @required -(BOOL)installWithOptions:(SentryOptions * _Nonnull)options;
9851005
[Abstract]
9861006
[Export ("installWithOptions:")]
987-
void InstallWithOptions (SentryOptions options);
1007+
bool InstallWithOptions (SentryOptions options);
9881008

9891009
// @optional -(void)uninstall;
9901010
[Export ("uninstall")]
@@ -1168,10 +1188,6 @@ interface SentryHub
11681188
[Export ("endSessionWithTimestamp:")]
11691189
void EndSessionWithTimestamp (NSDate timestamp);
11701190

1171-
// // @property (nonatomic, strong) NSMutableArray<NSObject<SentryIntegrationProtocol> *> * _Nonnull installedIntegrations;
1172-
// [Export ("installedIntegrations", ArgumentSemantic.Strong)]
1173-
// NSMutableArray<SentryIntegrationProtocol> InstalledIntegrations { get; set; }
1174-
11751191
// -(SentryId * _Nonnull)captureEvent:(SentryEvent * _Nonnull)event __attribute__((swift_name("capture(event:)")));
11761192
[Export ("captureEvent:")]
11771193
SentryId CaptureEvent (SentryEvent @event);
@@ -1252,10 +1268,9 @@ interface SentryHub
12521268
[Export ("bindClient:")]
12531269
void BindClient ([NullAllowed] SentryClient client);
12541270

1255-
// -(id _Nullable)getIntegration:(NSString * _Nonnull)integrationName;
1256-
[Export ("getIntegration:")]
1257-
[return: NullAllowed]
1258-
NSObject GetIntegration (string integrationName);
1271+
// -(BOOL)hasIntegration:(NSString * _Nonnull)integrationName;
1272+
[Export ("hasIntegration:")]
1273+
bool HasIntegration (string integrationName);
12591274

12601275
// -(BOOL)isIntegrationInstalled:(Class _Nonnull)integrationClass;
12611276
[Export ("isIntegrationInstalled:")]
@@ -1945,6 +1960,10 @@ interface SentryTransactionContext
19451960
[Export ("name")]
19461961
string Name { get; }
19471962

1963+
// @property (readonly, nonatomic) SentryTransactionNameSource nameSource;
1964+
[Export ("nameSource")]
1965+
SentryTransactionNameSource NameSource { get; }
1966+
19481967
// @property (nonatomic) SentrySampleDecision parentSampled;
19491968
[Export ("parentSampled", ArgumentSemantic.Assign)]
19501969
SentrySampleDecision ParentSampled { get; set; }
@@ -1971,8 +1990,8 @@ interface SentryTransactionContext
19711990
[Internal]
19721991
interface SentryUser : SentrySerializable //, INSCopying
19731992
{
1974-
// @property (copy, atomic) NSString * _Nonnull userId;
1975-
[Export ("userId")]
1993+
// @property (copy, atomic) NSString * _Nullable userId;
1994+
[NullAllowed, Export ("userId")]
19761995
string UserId { get; set; }
19771996

19781997
// @property (copy, atomic) NSString * _Nullable email;

src/Sentry/Platforms/iOS/Bindings/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
The files in this folder aren't "normal" C# files, but rather they are [Xamarin Objective-C bindings][1]. They were originally generated with [Objective Sharpie][2]. However, they are not purely auto-generated. Several modifications have been made:
1+
The files in this folder aren't "normal" C# files, but rather they are [Xamarin Objective-C bindings][1].
2+
They were originally generated with [Objective Sharpie][2], using the following command:
3+
4+
```
5+
sharpie bind <path to sentry-cocoa sdk root>/Sentry.xcodeproj -sdk iphoneos
6+
```
7+
8+
However, the files are not purely auto-generated. Several modifications have been made:
29

310
- Everything has been made internal, either via the `internal` keyword, or the `[Internal]` binding attribute.
411
- Named delegates have been replaced with `Func<T>` or `Action<T>` to work around https://github.com/xamarin/xamarin-macios/issues/15299

src/Sentry/Platforms/iOS/Bindings/StructsAndEnums.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ internal enum SentryLevel : ulong
2222
Fatal = 5
2323
}
2424

25+
[Native]
26+
internal enum SentryPermissionStatus : long
27+
{
28+
Unknown = 0,
29+
Granted,
30+
Partial,
31+
Denied
32+
}
33+
34+
[Native]
35+
internal enum SentryTransactionNameSource : long
36+
{
37+
Custom = 0,
38+
Url,
39+
Route,
40+
View,
41+
Component,
42+
Task
43+
}
44+
2545
[Native]
2646
internal enum SentryAppStartType : ulong
2747
{

src/Sentry/Platforms/iOS/Extensions/UserExtensions.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,12 @@ public static SentryCocoa.SentryUser ToCocoaUser(this User user)
1919
var cocoaUser = new SentryCocoa.SentryUser
2020
{
2121
Email = user.Email,
22+
UserId = user.Id,
2223
IpAddress = user.IpAddress,
2324
Username = user.Username,
2425
Data = user.Other.ToNullableNSDictionary()
2526
};
2627

27-
// Leave a null User ID uninitialized since it is optional.
28-
// It should be nullable in the Sentry Cocoa SDK, but isn't currently.
29-
// See: https://github.com/getsentry/sentry-cocoa/issues/2035
30-
if (user.Id != null)
31-
{
32-
cocoaUser.UserId = user.Id;
33-
}
34-
3528
return cocoaUser;
3629
}
3730
}

src/Sentry/Platforms/iOS/Sentry.iOS.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<PropertyGroup>
25-
<SentryCocoaSdkVersion>7.23.0</SentryCocoaSdkVersion>
25+
<SentryCocoaSdkVersion>7.24.1</SentryCocoaSdkVersion>
2626
<SentryCocoaSdkDirectory>$(BaseIntermediateOutputPath)sdks\Sentry\Cocoa\$(SentryCocoaSdkVersion)\</SentryCocoaSdkDirectory>
2727
<SentryCocoaFramework>$(SentryCocoaSdkDirectory)Carthage\Build\Sentry.xcframework</SentryCocoaFramework>
2828

0 commit comments

Comments
 (0)