Skip to content

Commit e3ad69a

Browse files
Revert "Bump to cocoa sdk v8.46.0 (#4103)" (#4202)
This reverts commit 690a169
1 parent afa6b11 commit e3ad69a

File tree

11 files changed

+161
-614
lines changed

11 files changed

+161
-614
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
- .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))
88

9+
### Fixes
10+
11+
- Revert "Bump Cocoa SDK from v8.39.0 to v8.46.0 (#4103)" ([#4202](https://github.com/getsentry/sentry-dotnet/pull/4202))
12+
- 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)
13+
914
### Dependencies
1015

1116
- Bump Native SDK from v0.8.4 to v0.8.5 ([#4189](https://github.com/getsentry/sentry-dotnet/pull/4189))

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
-->
5151
<PropertyGroup>
5252
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
53-
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">13.0</SupportedOSPlatformVersion>
53+
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">12.2</SupportedOSPlatformVersion>
5454
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
5555
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
5656
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>

Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-->
1111
<PropertyGroup>
1212
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
13-
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">13.0</SupportedOSPlatformVersion>
13+
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">12.2</SupportedOSPlatformVersion>
1414
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
1515
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
1616
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>

modules/sentry-cocoa.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = 8.46.0
1+
version = 8.39.0
22
repo = https://github.com/getsentry/sentry-cocoa

samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3333
<ApplicationVersion>1</ApplicationVersion>
3434

35-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">13.0</SupportedOSPlatformVersion>
35+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
3636
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
3737
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3838
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>

scripts/generate-cocoa-bindings.ps1

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Reference: https://github.com/xamarin/xamarin-macios/blob/main/docs/website/binding_types_reference_guide.md
2-
31
Set-StrictMode -Version Latest
42
$ErrorActionPreference = 'Stop'
53

@@ -117,6 +115,41 @@ $Text = $Text -replace '\bpublic\b', 'internal'
117115
# Remove static CFunctions class
118116
$Text = $Text -replace '(?ms)\nstatic class CFunctions.*?}\n', ''
119117

118+
# This enum resides in the Sentry-Swift.h
119+
# Appending it here so we don't need to import and create bindings for the entire header
120+
$SentryLevel = @'
121+
122+
[Native]
123+
internal enum SentryLevel : ulong
124+
{
125+
None = 0,
126+
Debug = 1,
127+
Info = 2,
128+
Warning = 3,
129+
Error = 4,
130+
Fatal = 5
131+
}
132+
'@
133+
134+
# This enum resides in the Sentry-Swift.h
135+
# Appending it here so we don't need to import and create bindings for the entire header
136+
$SentryTransactionNameSource = @'
137+
138+
[Native]
139+
internal enum SentryTransactionNameSource : long
140+
{
141+
Custom = 0,
142+
Url = 1,
143+
Route = 2,
144+
View = 3,
145+
Component = 4,
146+
Task = 5
147+
}
148+
'@
149+
150+
$Text += "`n$SentryLevel"
151+
$Text += "`n$SentryTransactionNameSource"
152+
120153
# Add header and output file
121154
$Text = "$Header`n`n$Text"
122155
$Text | Out-File "$BindingsPath/$File"
@@ -147,9 +180,6 @@ $Text = $Text -replace '\bISentrySerializable\b', 'SentrySerializable'
147180
# Remove INSCopying due to https://github.com/xamarin/xamarin-macios/issues/17130
148181
$Text = $Text -replace ': INSCopying,', ':' -replace '\s?[:,] INSCopying', ''
149182

150-
# Remove iOS attributes like [iOS (13, 0)]
151-
$Text = $Text -replace '\[iOS \(13, 0\)\]\n?', ''
152-
153183
# Fix delegate argument names
154184
$Text = $Text -replace '(NSError) arg\d', '$1 error'
155185
$Text = $Text -replace '(NSHttpUrlResponse) arg\d', '$1 response'
@@ -191,7 +221,7 @@ $Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Consta
191221

192222
# Update MethodToProperty translations
193223
$Text = $Text -replace '(Export \("get\w+"\)\]\n)\s*\[Verify \(MethodToProperty\)\]\n(.+ \{ get; \})', '$1$2'
194-
$Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations|AppStartMeasurementWithSpans|BaggageHttpHeader) \{ get; \})', '$1'
224+
$Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations) \{ get; \})', '$1'
195225
$Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+) \{ get; \}', '$1();'
196226

197227
# Allow weakly typed NSArray
@@ -204,7 +234,7 @@ $Text = $Text -replace '(DEPRECATED_MSG_ATTRIBUTE\()\n\s*', '$1'
204234
# Remove default IsEqual implementation (already implemented by NSObject)
205235
$Text = $Text -replace '(?ms)\n?^ *// [^\n]*isEqual:.*?$.*?;\n', ''
206236

207-
# Replace obsolete platform availability attributes
237+
# Replace obsolete platform avaialbility attributes
208238
$Text = $Text -replace '([\[,] )MacCatalyst \(', '$1Introduced (PlatformName.MacCatalyst, '
209239
$Text = $Text -replace '([\[,] )Mac \(', '$1Introduced (PlatformName.MacOSX, '
210240
$Text = $Text -replace '([\[,] )iOS \(', '$1Introduced (PlatformName.iOS, '
@@ -217,6 +247,7 @@ $Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*\[Export \("serialize"\)\]$\s*)
217247

218248
$Text = $Text -replace '.*SentryEnvelope .*?[\s\S]*?\n\n', ''
219249
$Text = $Text -replace '.*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n', ''
250+
$Text = $Text -replace '\n.*SentryReplayBreadcrumbConverter.*?[\s\S]*?\);\n', ''
220251

221252
$propertiesToRemove = @(
222253
'SentryAppStartMeasurement',
@@ -231,6 +262,41 @@ foreach ($property in $propertiesToRemove) {
231262
$Text = $Text -replace "\n.*property.*$property.*?[\s\S]*?\}\n", ''
232263
}
233264

265+
# This interface resides in the Sentry-Swift.h
266+
# Appending it here so we don't need to import and create bindings for the entire header
267+
$SentryId = @'
268+
269+
// @interface SentryId : NSObject
270+
[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")]
271+
[Internal]
272+
interface SentryId
273+
{
274+
// @property (nonatomic, strong, class) SentryId * _Nonnull empty;
275+
[Static]
276+
[Export ("empty", ArgumentSemantic.Strong)]
277+
SentryId Empty { get; set; }
278+
279+
// @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString;
280+
[Export ("sentryIdString")]
281+
string SentryIdString { get; }
282+
283+
// -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer));
284+
[Export ("initWithUuid:")]
285+
[DesignatedInitializer]
286+
NativeHandle Constructor (NSUuid uuid);
287+
288+
// -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer));
289+
[Export ("initWithUUIDString:")]
290+
[DesignatedInitializer]
291+
NativeHandle Constructor (string uuidString);
292+
293+
// @property (readonly, nonatomic) NSUInteger hash;
294+
[Export ("hash")]
295+
nuint Hash { get; }
296+
}
297+
'@
298+
299+
$Text += "`n$SentryId"
234300

235301
# Add header and output file
236302
$Text = "$Header`n`n$Text"

0 commit comments

Comments
 (0)