Skip to content

Commit 3e1852a

Browse files
committed
fix: Remove extra @objc from SessionTracker
1 parent 3da037d commit 3e1852a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Sources/Swift/Integrations/Session/SessionTracker.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ typealias Application = NSApplication
1010

1111
/// Tracks sessions for release health. For more info see:
1212
/// https://docs.sentry.io/workflow/releases/health/#session
13-
@_spi(Private) @objc(SentrySessionTracker) public final class SessionTracker: NSObject {
13+
final class SessionTracker {
1414

1515
// MARK: Private
1616

@@ -39,9 +39,9 @@ typealias Application = NSApplication
3939
self.notificationCenter.removeObserver(self, name: nil, object: nil)
4040
}
4141

42-
// MARK: Public
42+
// MARK: Internal
4343

44-
@objc public func start() {
44+
func start() {
4545
// We don't want to use WillEnterForeground because tvOS doesn't call it when it launches an app
4646
// the first time. It only calls it when the app was open and the user navigates back to it.
4747
// DidEnterBackground is called when the app launches a background task so we would need to
@@ -73,7 +73,7 @@ typealias Application = NSApplication
7373
#endif
7474
}
7575

76-
@objc public func stop() {
76+
func stop() {
7777
SentrySDKInternal.currentHub().endSession()
7878

7979
removeObservers()
@@ -83,7 +83,7 @@ typealias Application = NSApplication
8383
wasStartSessionCalled = false
8484
}
8585

86-
@objc public func removeObservers() {
86+
func removeObservers() {
8787
#if ((os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT) || ((os(macOS) || targetEnvironment(macCatalyst)) && !SENTRY_NO_UIKIT)
8888
// Remove the observers with the most specific detail possible, see
8989
// https://developer.apple.com/documentation/foundation/nsnotificationcenter/1413994-removeobserver
@@ -94,8 +94,6 @@ typealias Application = NSApplication
9494
#endif
9595
}
9696

97-
// MARK: Internal
98-
9997
let options: Options
10098
let dateProvider: SentryCurrentDateProvider
10199
let notificationCenter: SentryNSNotificationCenterWrapper

Sources/Swift/SentryDependencyContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension SentryFileManager: SentryFileManagerProtocol { }
9898
return defaultApplicationProvider()
9999
}
100100

101-
@objc(getSessionTrackerWithOptions:) public func getSessionTracker(with options: Options) -> SessionTracker {
101+
func getSessionTracker(with options: Options) -> SessionTracker {
102102
return SessionTracker(options: options, applicationProvider: defaultApplicationProvider, dateProvider: dateProvider, notificationCenter: notificationCenterWrapper)
103103
}
104104

0 commit comments

Comments
 (0)