Skip to content

Commit 95331f3

Browse files
feat: Track usage of appHangTrackingV2 (#4445)
Add appHangTrackingV2 to the list of enabled features when the option enableAppHangTrackingV2 is enabled.
1 parent dfde71c commit 95331f3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CHANGELOG.md

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

77
- feat: API to manually start/stop Session Replay (#4414)
88
- Custom redact modifier for SwiftUI (#4362, #4392)
9+
- Track usage of appHangTrackingV2 (#4445)
910

1011
### Removal of Experimental API
1112

Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import Foundation
3535
if options.swiftAsyncStacktraces {
3636
features.append("swiftAsyncStacktraces")
3737
}
38+
39+
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
40+
if options.enableAppHangTrackingV2 {
41+
features.append("appHangTrackingV2")
42+
}
43+
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
3844

3945
return features
4046
}

Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase {
2525
options.enablePreWarmedAppStartTracing = true
2626
#endif // canImport(UIKit)
2727
#endif // os(iOS) || os(tvOS)
28+
29+
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
30+
options.enableAppHangTrackingV2 = true
31+
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
2832

2933
let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options)
3034

@@ -42,5 +46,9 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase {
4246
XCTAssert(features.contains("preWarmedAppStartTracing"))
4347
#endif // canImport(UIKit)
4448
#endif // os(iOS) || os(tvOS)
49+
50+
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
51+
XCTAssert(features.contains("appHangTrackingV2"))
52+
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
4553
}
4654
}

0 commit comments

Comments
 (0)