Skip to content

Commit 7184c36

Browse files
committed
revert changes in session tracker
1 parent bf0d498 commit 7184c36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/Swift/Core/Integrations/FramesTracking/SentryFramesTracker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#if (os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
55
import UIKit
66
private typealias CrossPlatformApplication = UIApplication
7-
#elseif os(macOS)
7+
#elseif (os(macOS) || targetEnvironment(macCatalyst)) && !SENTRY_NO_UIKIT
88
import AppKit
99
private typealias CrossPlatformApplication = NSApplication
1010
#endif

Sources/Swift/Integrations/Session/SessionTracker.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#if (os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
44
import UIKit
55
typealias Application = UIApplication
6-
#elseif os(macOS)
6+
#elseif (os(macOS) || targetEnvironment(macCatalyst)) && !SENTRY_NO_UIKIT
77
import AppKit
88
typealias Application = NSApplication
99
#endif
@@ -50,7 +50,7 @@ final class SessionTracker {
5050
// WillTerminate is called no matter if started from the background or launched into the
5151
// foreground.
5252

53-
#if ((os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT) || os(macOS)
53+
#if ((os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT) || ((os(macOS) || targetEnvironment(macCatalyst)) && !SENTRY_NO_UIKIT)
5454

5555
// Call before subscribing to the notifications to avoid that didBecomeActive gets called before
5656
// ending the cached session.
@@ -84,7 +84,7 @@ final class SessionTracker {
8484
}
8585

8686
func removeObservers() {
87-
#if ((os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT) || os(macOS)
87+
#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
9090
notificationCenter.removeObserver(self, name: Application.didBecomeActiveNotification, object: nil)

0 commit comments

Comments
 (0)