Skip to content

Commit 2b0eac0

Browse files
authored
ref: Cleanup SentryOptions implementation (#6644)
1 parent 6528493 commit 2b0eac0

File tree

4 files changed

+94
-168
lines changed

4 files changed

+94
-168
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Makes `SentryEventDecodable` internal (#5808)
1818
- The `span` property on `SentryScope` is now readonly (#5866)
1919
- Removes deprecated SentryDebugImageProvider class (#5598)
20+
- Properties on SentryOptions that had no effect on the WithoutUIKit variant are now removed from the API (#6644)
2021
- Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
2122
- Removes deprecated TraceContext initializers (#6348)
2223
- Removes deprecated user feedback API, this is replaced with the new feedback API (#5591)

Sources/Sentry/Public/SentryOptions.h

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ NS_SWIFT_NAME(Options)
305305
*/
306306
@property (nonatomic) SentryScope * (^initialScope)(SentryScope *);
307307

308-
#if SENTRY_UIKIT_AVAILABLE
308+
#if SENTRY_HAS_UIKIT
309309
/**
310310
* When enabled, the SDK tracks performance for UIViewController subclasses.
311311
* @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
@@ -314,6 +314,14 @@ NS_SWIFT_NAME(Options)
314314
*/
315315
@property (nonatomic, assign) BOOL enableUIViewControllerTracing;
316316

317+
/**
318+
* When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when
319+
* the app appears stuck to the user but can still render a few frames.
320+
*
321+
* @note The default is @c YES.
322+
*/
323+
@property (nonatomic, assign) BOOL enableReportNonFullyBlockingAppHangs;
324+
317325
/**
318326
* Automatically attaches a screenshot when capturing an error or exception.
319327
* @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit
@@ -380,7 +388,7 @@ NS_SWIFT_NAME(Options)
380388
*/
381389
@property (nonatomic, assign) BOOL enablePreWarmedAppStartTracing;
382390

383-
#endif // SENTRY_UIKIT_AVAILABLE
391+
#endif // SENTRY_HAS_UIKIT
384392

385393
#if SENTRY_TARGET_REPLAY_SUPPORTED
386394

@@ -572,18 +580,6 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull
572580
*/
573581
@property (nonatomic, assign) BOOL enableAppHangTracking;
574582

575-
#if SENTRY_UIKIT_AVAILABLE
576-
577-
/**
578-
* When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when
579-
* the app appears stuck to the user but can still render a few frames.
580-
*
581-
* @note The default is @c YES.
582-
*/
583-
@property (nonatomic, assign) BOOL enableReportNonFullyBlockingAppHangs;
584-
585-
#endif // SENTRY_UIKIT_AVAILABLE
586-
587583
/**
588584
* The minimum amount of time an app should be unresponsive to be classified as an App Hanging.
589585
* @note The actual amount may be a little longer.

Sources/Sentry/SentryOptions.m

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,6 @@ - (void)setTracesSampleRate:(NSNumber *)tracesSampleRate
263263
}
264264
}
265265

266-
- (void)setTracesSampler:(SentryTracesSamplerCallback)tracesSampler
267-
{
268-
_tracesSampler = tracesSampler;
269-
}
270-
271266
- (BOOL)isTracingEnabled
272267
{
273268
return (_tracesSampleRate != nil && [_tracesSampleRate doubleValue] > 0)
@@ -289,39 +284,6 @@ - (BOOL)isProfilingCorrelatedToTraces
289284

290285
#if SENTRY_UIKIT_AVAILABLE
291286

292-
- (void)setEnableUIViewControllerTracing:(BOOL)enableUIViewControllerTracing
293-
{
294-
# if SENTRY_HAS_UIKIT
295-
_enableUIViewControllerTracing = enableUIViewControllerTracing;
296-
# else
297-
SENTRY_GRACEFUL_FATAL(
298-
@"enableUIViewControllerTracing only works with UIKit enabled. Ensure you're "
299-
@"using the right configuration of Sentry that links UIKit.");
300-
# endif // SENTRY_HAS_UIKIT
301-
}
302-
303-
- (void)setAttachScreenshot:(BOOL)attachScreenshot
304-
{
305-
# if SENTRY_HAS_UIKIT
306-
_attachScreenshot = attachScreenshot;
307-
# else
308-
SENTRY_GRACEFUL_FATAL(
309-
@"attachScreenshot only works with UIKit enabled. Ensure you're using the "
310-
@"right configuration of Sentry that links UIKit.");
311-
# endif // SENTRY_HAS_UIKIT
312-
}
313-
314-
- (void)setAttachViewHierarchy:(BOOL)attachViewHierarchy
315-
{
316-
# if SENTRY_HAS_UIKIT
317-
_attachViewHierarchy = attachViewHierarchy;
318-
# else
319-
SENTRY_GRACEFUL_FATAL(
320-
@"attachViewHierarchy only works with UIKit enabled. Ensure you're using the "
321-
@"right configuration of Sentry that links UIKit.");
322-
# endif // SENTRY_HAS_UIKIT
323-
}
324-
325287
# if SENTRY_TARGET_REPLAY_SUPPORTED
326288

327289
- (BOOL)enableViewRendererV2
@@ -336,39 +298,6 @@ - (BOOL)enableFastViewRendering
336298

337299
# endif // SENTRY_TARGET_REPLAY_SUPPORTED
338300

339-
- (void)setEnableUserInteractionTracing:(BOOL)enableUserInteractionTracing
340-
{
341-
# if SENTRY_HAS_UIKIT
342-
_enableUserInteractionTracing = enableUserInteractionTracing;
343-
# else
344-
SENTRY_GRACEFUL_FATAL(
345-
@"enableUserInteractionTracing only works with UIKit enabled. Ensure you're "
346-
@"using the right configuration of Sentry that links UIKit.");
347-
# endif // SENTRY_HAS_UIKIT
348-
}
349-
350-
- (void)setIdleTimeout:(NSTimeInterval)idleTimeout
351-
{
352-
# if SENTRY_HAS_UIKIT
353-
_idleTimeout = idleTimeout;
354-
# else
355-
SENTRY_GRACEFUL_FATAL(
356-
@"idleTimeout only works with UIKit enabled. Ensure you're using the right "
357-
@"configuration of Sentry that links UIKit.");
358-
# endif // SENTRY_HAS_UIKIT
359-
}
360-
361-
- (void)setEnablePreWarmedAppStartTracing:(BOOL)enablePreWarmedAppStartTracing
362-
{
363-
# if SENTRY_HAS_UIKIT
364-
_enablePreWarmedAppStartTracing = enablePreWarmedAppStartTracing;
365-
# else
366-
SENTRY_GRACEFUL_FATAL(
367-
@"enablePreWarmedAppStartTracing only works with UIKit enabled. Ensure you're "
368-
@"using the right configuration of Sentry that links UIKit.");
369-
# endif // SENTRY_HAS_UIKIT
370-
}
371-
372301
#endif // SENTRY_UIKIT_AVAILABLE
373302

374303
- (void)setEnableSpotlight:(BOOL)value

sdk_api.json

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -17945,6 +17945,89 @@
1794517945
}
1794617946
]
1794717947
},
17948+
{
17949+
"kind": "Var",
17950+
"name": "enableReportNonFullyBlockingAppHangs",
17951+
"printedName": "enableReportNonFullyBlockingAppHangs",
17952+
"children": [
17953+
{
17954+
"kind": "TypeNominal",
17955+
"name": "Bool",
17956+
"printedName": "Swift.Bool",
17957+
"usr": "s:Sb"
17958+
}
17959+
],
17960+
"declKind": "Var",
17961+
"usr": "c:objc(cs)SentryOptions(py)enableReportNonFullyBlockingAppHangs",
17962+
"moduleName": "Sentry",
17963+
"isOpen": true,
17964+
"objc_name": "enableReportNonFullyBlockingAppHangs",
17965+
"declAttributes": [
17966+
"ObjC",
17967+
"Dynamic"
17968+
],
17969+
"accessors": [
17970+
{
17971+
"kind": "Accessor",
17972+
"name": "Get",
17973+
"printedName": "Get()",
17974+
"children": [
17975+
{
17976+
"kind": "TypeNominal",
17977+
"name": "Bool",
17978+
"printedName": "Swift.Bool",
17979+
"usr": "s:Sb"
17980+
}
17981+
],
17982+
"declKind": "Accessor",
17983+
"usr": "c:objc(cs)SentryOptions(im)enableReportNonFullyBlockingAppHangs",
17984+
"moduleName": "Sentry",
17985+
"isOpen": true,
17986+
"objc_name": "enableReportNonFullyBlockingAppHangs",
17987+
"declAttributes": [
17988+
"DiscardableResult",
17989+
"ObjC",
17990+
"Dynamic"
17991+
],
17992+
"accessorKind": "get"
17993+
},
17994+
{
17995+
"kind": "Accessor",
17996+
"name": "Set",
17997+
"printedName": "Set()",
17998+
"children": [
17999+
{
18000+
"kind": "TypeNameAlias",
18001+
"name": "Void",
18002+
"printedName": "Swift.Void",
18003+
"children": [
18004+
{
18005+
"kind": "TypeNominal",
18006+
"name": "Void",
18007+
"printedName": "()"
18008+
}
18009+
]
18010+
},
18011+
{
18012+
"kind": "TypeNominal",
18013+
"name": "Bool",
18014+
"printedName": "Swift.Bool",
18015+
"usr": "s:Sb"
18016+
}
18017+
],
18018+
"declKind": "Accessor",
18019+
"usr": "c:objc(cs)SentryOptions(im)setEnableReportNonFullyBlockingAppHangs:",
18020+
"moduleName": "Sentry",
18021+
"isOpen": true,
18022+
"objc_name": "setEnableReportNonFullyBlockingAppHangs:",
18023+
"declAttributes": [
18024+
"ObjC",
18025+
"Dynamic"
18026+
],
18027+
"accessorKind": "set"
18028+
}
18029+
]
18030+
},
1794818031
{
1794918032
"kind": "Var",
1795018033
"name": "attachScreenshot",
@@ -20316,89 +20399,6 @@
2031620399
}
2031720400
]
2031820401
},
20319-
{
20320-
"kind": "Var",
20321-
"name": "enableReportNonFullyBlockingAppHangs",
20322-
"printedName": "enableReportNonFullyBlockingAppHangs",
20323-
"children": [
20324-
{
20325-
"kind": "TypeNominal",
20326-
"name": "Bool",
20327-
"printedName": "Swift.Bool",
20328-
"usr": "s:Sb"
20329-
}
20330-
],
20331-
"declKind": "Var",
20332-
"usr": "c:objc(cs)SentryOptions(py)enableReportNonFullyBlockingAppHangs",
20333-
"moduleName": "Sentry",
20334-
"isOpen": true,
20335-
"objc_name": "enableReportNonFullyBlockingAppHangs",
20336-
"declAttributes": [
20337-
"ObjC",
20338-
"Dynamic"
20339-
],
20340-
"accessors": [
20341-
{
20342-
"kind": "Accessor",
20343-
"name": "Get",
20344-
"printedName": "Get()",
20345-
"children": [
20346-
{
20347-
"kind": "TypeNominal",
20348-
"name": "Bool",
20349-
"printedName": "Swift.Bool",
20350-
"usr": "s:Sb"
20351-
}
20352-
],
20353-
"declKind": "Accessor",
20354-
"usr": "c:objc(cs)SentryOptions(im)enableReportNonFullyBlockingAppHangs",
20355-
"moduleName": "Sentry",
20356-
"isOpen": true,
20357-
"objc_name": "enableReportNonFullyBlockingAppHangs",
20358-
"declAttributes": [
20359-
"DiscardableResult",
20360-
"ObjC",
20361-
"Dynamic"
20362-
],
20363-
"accessorKind": "get"
20364-
},
20365-
{
20366-
"kind": "Accessor",
20367-
"name": "Set",
20368-
"printedName": "Set()",
20369-
"children": [
20370-
{
20371-
"kind": "TypeNameAlias",
20372-
"name": "Void",
20373-
"printedName": "Swift.Void",
20374-
"children": [
20375-
{
20376-
"kind": "TypeNominal",
20377-
"name": "Void",
20378-
"printedName": "()"
20379-
}
20380-
]
20381-
},
20382-
{
20383-
"kind": "TypeNominal",
20384-
"name": "Bool",
20385-
"printedName": "Swift.Bool",
20386-
"usr": "s:Sb"
20387-
}
20388-
],
20389-
"declKind": "Accessor",
20390-
"usr": "c:objc(cs)SentryOptions(im)setEnableReportNonFullyBlockingAppHangs:",
20391-
"moduleName": "Sentry",
20392-
"isOpen": true,
20393-
"objc_name": "setEnableReportNonFullyBlockingAppHangs:",
20394-
"declAttributes": [
20395-
"ObjC",
20396-
"Dynamic"
20397-
],
20398-
"accessorKind": "set"
20399-
}
20400-
]
20401-
},
2040220402
{
2040320403
"kind": "Var",
2040420404
"name": "appHangTimeoutInterval",

0 commit comments

Comments
 (0)