Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ This changelog lists every breaking change. For a high-level overview and upgrad
- Add `sentry.replay_id` attribute to logs ([#6515](https://github.com/getsentry/sentry-cocoa/pull/6515))
- Structured Logs: Add log APIs to `Hub` and `Client` (#6737)
- Add options to customize UserFeedback error messages (#6790)
- Add isiOSAppOnVisionOS, isiOSAppOnMac, isMacCatalystApp to device context #6939
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 🚫 The changelog entry seems to be part of an already released section ## 9.0.0.
    Consider moving the entry to the ## Unreleased section, please.


### Fixes

Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SampleAppDebugMenu.shared.display()

metricKit.receiveReports()

return true
}

Expand Down
4 changes: 4 additions & 0 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@
D4D0E1E82E9D040A00358814 /* SentrySessionReplayEnvironmentCheckerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D0E1E22E9D040800358814 /* SentrySessionReplayEnvironmentCheckerTests.swift */; };
D4D12E7A2DFC608800DC45C4 /* SentryScreenshotOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D12E792DFC607F00DC45C4 /* SentryScreenshotOptionsTests.swift */; };
D4DEE6592E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D4DEE6582E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m */; };
D4E1CE6A2EDDCBD900D2EAC1 /* SentryProcessInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4E1CE642EDDCBD300D2EAC1 /* SentryProcessInfoTests.swift */; };
D4E3F35D2D4A864600F79E2B /* SentryNSDictionarySanitizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42E48582D48FC8F00D251BC /* SentryNSDictionarySanitizeTests.swift */; };
D4E3F35E2D4A877300F79E2B /* SentryNSDictionarySanitize+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = D41909942D490006002B83D0 /* SentryNSDictionarySanitize+Tests.m */; };
D4E9420A2E9D1CFB00DB7521 /* TestSessionReplayEnvironmentChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4E942042E9D1CF300DB7521 /* TestSessionReplayEnvironmentChecker.swift */; };
Expand Down Expand Up @@ -2183,6 +2184,7 @@
D4D0E1E22E9D040800358814 /* SentrySessionReplayEnvironmentCheckerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySessionReplayEnvironmentCheckerTests.swift; sourceTree = "<group>"; };
D4D12E792DFC607F00DC45C4 /* SentryScreenshotOptionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenshotOptionsTests.swift; sourceTree = "<group>"; };
D4DEE6582E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfileTimeseriesTests.m; sourceTree = "<group>"; };
D4E1CE642EDDCBD300D2EAC1 /* SentryProcessInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryProcessInfoTests.swift; sourceTree = "<group>"; };
D4E942042E9D1CF300DB7521 /* TestSessionReplayEnvironmentChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSessionReplayEnvironmentChecker.swift; sourceTree = "<group>"; };
D4E9420B2E9D1D7600DB7521 /* TestSessionReplayEnvironmentCheckerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSessionReplayEnvironmentCheckerTests.swift; sourceTree = "<group>"; };
D4ECA3FF2E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDummyPrivateEmptyClass.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3596,6 +3598,7 @@
7BD7299B24654CD500EA3610 /* Helper */ = {
isa = PBXGroup;
children = (
D4E1CE642EDDCBD300D2EAC1 /* SentryProcessInfoTests.swift */,
D4A0C22A2E9E3CE100791353 /* InfoPlist */,
F4A930242E661856006DA6EF /* SentryMobileProvisionParserTests.swift */,
D4F7BD7C2E4373BB004A2D77 /* SentryLevelMapperTests.swift */,
Expand Down Expand Up @@ -6284,6 +6287,7 @@
D8019910286B089000C277F0 /* SentryCrashReportSinkTests.swift in Sources */,
D885266427739D01001269FC /* SentryFileIOTrackingIntegrationTests.swift in Sources */,
7BBD18992449DE9D00427C76 /* TestRateLimits.swift in Sources */,
D4E1CE6A2EDDCBD900D2EAC1 /* SentryProcessInfoTests.swift in Sources */,
7B04A9AB24EA5F8D00E710B1 /* SentryUserTests.swift in Sources */,
7BA61CCF247EB59500C130A8 /* SentryCrashUUIDConversionTests.swift in Sources */,
7BBD188D2448453600427C76 /* SentryHttpDateParserTests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#import "SentryDefines.h"

#if TARGET_OS_IOS || TARGET_OS_TV
# define SENTRY_UIKIT_AVAILABLE 1
#else
# define SENTRY_UIKIT_AVAILABLE 0
#endif

#if SENTRY_HAS_UIKIT
# import "SentryAppStartTracker.h"
# import "SentryDefaultUIViewControllerPerformanceTracker.h"
Expand Down
8 changes: 6 additions & 2 deletions SentryTestUtils/Sources/TestDisplayLinkWrapper.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
@_spi(Private) @testable import Sentry

#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(tvOS) || os(visionOS) || targetEnvironment(macCatalyst)

public enum GPUFrame {
case normal
Expand All @@ -18,7 +18,7 @@ public enum FrameRate: UInt64 {
}
}

@_spi(Private) public class TestDisplayLinkWrapper: SentryDisplayLinkWrapper, SentryReplayDisplayLinkWrapper {
@_spi(Private) public class TestDisplayLinkWrapper: SentryDisplayLinkWrapper {
public var target: AnyObject!
public var selector: Selector!
public var currentFrameRate: FrameRate = .low
Expand Down Expand Up @@ -146,3 +146,7 @@ public enum FrameRate: UInt64 {
}

#endif

#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
extension TestDisplayLinkWrapper: SentryReplayDisplayLinkWrapper {}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public var environment: [String: String]?
public var isiOSAppOnMac: Bool?
public var isMacCatalystApp: Bool?
public var isiOSAppOnVisionOS: Bool?
}

public var overrides = Override()
Expand Down Expand Up @@ -45,4 +46,8 @@
public var isMacCatalystApp: Bool {
return overrides.isMacCatalystApp ?? ProcessInfo.processInfo.isMacCatalystApp
}

public var isiOSAppOnVisionOS: Bool {
return overrides.isiOSAppOnVisionOS ?? ProcessInfo.processInfo.isiOSAppOnVisionOS
}
}
14 changes: 14 additions & 0 deletions Sources/Swift/Helper/SentryProcessInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

@available(macOS 12.0, *)
var isMacCatalystApp: Bool { get }

var isiOSAppOnVisionOS: Bool { get }
}

// This is needed because a file that only contains an @objc extension will get automatically stripped out
Expand All @@ -26,4 +28,16 @@
public var processPath: String? {
Bundle.main.executablePath
}

public var isiOSAppOnVisionOS: Bool {
if #available(iOS 26.1, visionOS 26.1, *) {
// Use official API when available
// https://developer.apple.com/documentation/foundation/processinfo/isiosapponvision
return self.isiOSAppOnVision

Check failure on line 36 in Sources/Swift/Helper/SentryProcessInfo.swift

View workflow job for this annotation

GitHub Actions / Check API Stability ()

value of type 'ProcessInfo' has no member 'isiOSAppOnVision'

Check failure on line 36 in Sources/Swift/Helper/SentryProcessInfo.swift

View workflow job for this annotation

GitHub Actions / Lint

value of type 'ProcessInfo' has no member 'isiOSAppOnVision'

Check failure on line 36 in Sources/Swift/Helper/SentryProcessInfo.swift

View workflow job for this annotation

GitHub Actions / Fast XCFramework Slice (Sentry Dynamic, iOS arm64) / iphoneos

value of type 'ProcessInfo' has no member 'isiOSAppOnVision'

Check failure on line 36 in Sources/Swift/Helper/SentryProcessInfo.swift

View workflow job for this annotation

GitHub Actions / Fast Unit Tests (iOS 18) / Unit iOS 18 Sentry

value of type 'ProcessInfo' has no member 'isiOSAppOnVision'

Check failure on line 36 in Sources/Swift/Helper/SentryProcessInfo.swift

View workflow job for this annotation

GitHub Actions / Analyze (cpp)

value of type 'ProcessInfo' has no member 'isiOSAppOnVision'
} else {
// Fallback for older versions: `UIWindowSceneGeometryPreferencesVision` is only available on visionOS
// https://developer.apple.com/documentation/uikit/uiwindowscene/geometrypreferences/vision?language=objc
return NSClassFromString("UIWindowSceneGeometryPreferencesVision") != nil
}
}
}
9 changes: 8 additions & 1 deletion Sources/Swift/SentryCrash/SentryCrashWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ public final class SentryCrashWrapper: NSObject {

deviceData["locale"] = Locale.autoupdatingCurrent.identifier

if #available(macOS 12, *) {
deviceData["ios_app_on_macos"] = self.processInfoWrapper.isiOSAppOnMac
deviceData["mac_catalyst_app"] = self.processInfoWrapper.isMacCatalystApp
}

deviceData["ios_app_on_visionos"] = self.processInfoWrapper.isiOSAppOnVisionOS

// Set screen dimensions if available
setScreenDimensions(&deviceData)

Expand Down Expand Up @@ -210,7 +217,7 @@ public final class SentryCrashWrapper: NSObject {

if self.processInfoWrapper.isMacCatalystApp {
runtimeContext["name"] = "Mac Catalyst App"
runtimeContext["raw_description"] = "raw_description"
runtimeContext["raw_description"] = "mac-catalyst-app"
}
}

Expand Down
18 changes: 18 additions & 0 deletions Tests/SentryTests/Helper/SentryDeviceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ - (void)testCPUArchitecture
// TODO: create a watch UI test target to test this branch as it cannot run on the watch
// simulator
SENTRY_ASSERT_CONTAINS(arch, @"arm"); // Real ο£ΏWatches
#elif TARGET_OS_VISION
# if TARGET_OS_SIMULATOR
# if TARGET_CPU_ARM64
SENTRY_ASSERT_CONTAINS(arch, @"arm"); // Vision Pro simulator on M1 macs
# elif TARGET_CPU_X86_64
SENTRY_ASSERT_CONTAINS(arch, @"x86"); // Vision Pro simulator on Intel macs
# else
XCTFail(@"Unexpected CPU type on test host.");
# endif // TARGET_CPU_ARM64
# else
SENTRY_ASSERT_CONTAINS(arch, @"arm"); // Real Vision Pro devices
# endif
#else
XCTFail(@"Unexpected device OS");
#endif
Expand Down Expand Up @@ -127,6 +139,8 @@ - (void)testOSName
#elif TARGET_OS_WATCH
// TODO: create a watch UI test target to test this branch
SENTRY_ASSERT_EQUAL(osName, @"watchOS");
#elif TARGET_OS_VISION
SENTRY_ASSERT_EQUAL(osName, @"visionOS");
#else
XCTFail(@"Unexpected device OS");
#endif
Expand Down Expand Up @@ -161,6 +175,8 @@ - (void)testDeviceModel
// TODO: create a watch UI test target to test this branch as it cannot run on the watch
// simulator
SENTRY_ASSERT_CONTAINS(modelName, @"Watch");
#elif TARGET_OS_VISION
SENTRY_ASSERT_CONTAINS(modelName, @"RealityDevice");
#else
XCTFail(@"Unexpected target OS");
#endif
Expand Down Expand Up @@ -205,6 +221,8 @@ - (void)testSimulatedDeviceModel
// TODO: create a watch UI test target to test this branch as it cannot run on the watch
// simulator
SENTRY_ASSERT_CONTAINS(modelName, @"Watch");
# elif TARGET_OS_VISION
SENTRY_ASSERT_CONTAINS(modelName, @"RealityDevice");
# else
XCTFail(@"Unexpected device OS");
# endif
Expand Down
20 changes: 20 additions & 0 deletions Tests/SentryTests/Helper/SentryProcessInfoTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@_spi(Private) @testable import Sentry
import XCTest

final class SentryProcessInfoTests: XCTestCase {

func testIsiOSAppOnVisionOS() throws {
// -- Arrange --
let processInfo = ProcessInfo.processInfo

// -- Act --
let result = processInfo.isiOSAppOnVisionOS

// -- Assert --
// This test only asserts that the property exists, as we can not adapt the process info in tests
// and a test running on visionOS is also not an iOS app.
//
// We asserted this manually by running iOS-Swift on visionOS, then exploring the data in `lldb`
XCTAssertFalse(result, "isiOSAppOnVisionOS should be false when not running on visionOS")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase {

let tracker = try XCTUnwrap(Dynamic(sut).tracker.asAnyObject as? SentryANRTracker)

#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(tvOS) || os(visionOS) || targetEnvironment(macCatalyst)
XCTAssertTrue(tracker.helper is SentryANRTrackerV2, "Expected SentryANRTrackerV2, but got \(type(of: tracker))")
#else
XCTAssertTrue(tracker.helper is SentryANRTrackerV1, "Expected SentryANRTrackerV1 on macOS, but got \(type(of: tracker))")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import Foundation
@_spi(Private) import SentryTestUtils
import XCTest

#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)

class TestDelayedWrapper: SentryDelayedFramesTracker {}

#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
class SentryTimeToDisplayTrackerTest: XCTestCase {

private class Fixture {
Expand Down Expand Up @@ -323,7 +322,7 @@ class SentryTimeToDisplayTrackerTest: XCTestCase {
let expectedInvocations = invocationsBefore + 1
XCTAssertEqual(dispatchQueueWrapper.blockOnMainInvocations.count, expectedInvocations, "reportFullyDisplayed should be dispatched on the main queue. ")
}

func testNotWaitingForFullyDisplayed_AfterTracerTimesOut() throws {
fixture.dateProvider.setDate(date: Date(timeIntervalSince1970: 9))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SentrySessionTrackerTests: XCTestCase {
let client: TestClient!
let sentryCrash: TestSentryCrashWrapper

#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
let _application: TestSentryUIApplication
#else
let _application: TestSentryNSApplication
Expand All @@ -38,7 +38,7 @@ class SentrySessionTrackerTests: XCTestCase {

sentryCrash = TestSentryCrashWrapper(processInfoWrapper: ProcessInfo.processInfo)

#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
_application = TestSentryUIApplication()
_application.unsafeApplicationState = .inactive
#else
Expand Down Expand Up @@ -537,7 +537,7 @@ class SentrySessionTrackerTests: XCTestCase {
// MARK: - Helpers

private func startSutInAppDelegate() {
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// The Sentry SDK should be initialized in the `UIAppDelegate.didFinishLaunchingWithOptions`
// At this point the application state is `inactive`, because the app just launched but did not
// become the active app yet.
Expand Down Expand Up @@ -565,7 +565,7 @@ class SentrySessionTrackerTests: XCTestCase {
// We remove the observers, to ensure future notifications are not handled.
sut.removeObservers()

#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// When the app stops, the app state is `inactive`.
// This can be observed by viewing the application state in `UIAppDelegate.applicationDidEnterBackground`.
fixture._application.unsafeApplicationState = .inactive
Expand All @@ -580,7 +580,7 @@ class SentrySessionTrackerTests: XCTestCase {

private func crashSut() {
sut.removeObservers()
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// When the app stops, the app state is `inactive`.
//
// This can be observed by viewing the application state in `UIAppDelegate.applicationDidEnterBackground`.
Expand All @@ -600,7 +600,7 @@ class SentrySessionTrackerTests: XCTestCase {
}

private func goToForeground() {
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// When the app becomes active, the app state is `active`.
// This can be observed by viewing the application state in `UIAppDelegate.applicationDidBecomeActive`.
fixture._application.unsafeApplicationState = .active
Expand All @@ -622,7 +622,7 @@ class SentrySessionTrackerTests: XCTestCase {
private func goToBackground() {
// Before an app goes to background, it is still active and will resign from being active.
willResignActive()
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// It is expected that the app state is background when the didEnterBackground is called
fixture._application.unsafeApplicationState = .background
fixture.notificationCenter
Expand All @@ -642,7 +642,7 @@ class SentrySessionTrackerTests: XCTestCase {
}

private func willResignActive() {
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// When the app is about to resign being active, it is still active.
//
// This can be observed by viewing the application state in `UIAppDelegate.applicationWillResignActive`.
Expand All @@ -665,7 +665,7 @@ class SentrySessionTrackerTests: XCTestCase {

private func hybridSdkDidBecomeActive() {
// When an app did become active, it is in the active state.
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
fixture._application.unsafeApplicationState = .active
#else
fixture._application.setIsActive(true)
Expand All @@ -687,7 +687,7 @@ class SentrySessionTrackerTests: XCTestCase {
}

private func willTerminate() {
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
// When terminating an app, it will first move to the background and then terminate.
//
// This can be observed by viewing the application state in `UIAppDelegate.applicationWillTerminate`.
Expand Down Expand Up @@ -876,7 +876,7 @@ class SentrySessionTrackerTests: XCTestCase {

private func postHybridSdkDidBecomeActiveNotification() {
// When the hybrid SDK posts this notification, the app should be in active state
#if os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
#if (os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
fixture._application.unsafeApplicationState = .active
#else
fixture._application.setIsActive(true)
Expand Down
14 changes: 8 additions & 6 deletions Tests/SentryTests/PrivateSentrySDKOnlyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
XCTAssertNil(PrivateSentrySDKOnly.envelope(with: itemData))
}

#if canImport(UIKit)
#if canImport(UIKit) && !os(visionOS)
func testGetAppStartMeasurement() {
let appStartMeasurement = TestData.getAppStartMeasurement(type: .warm, runtimeInitSystemTimestamp: 1)
SentrySDKInternal.setAppStartMeasurement(appStartMeasurement)
Expand Down Expand Up @@ -240,7 +240,7 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
XCTAssertEqual(PrivateSentrySDKOnly.options.enabled, true)
}

#if !os(tvOS) && !os(watchOS)
#if !os(tvOS) && !os(watchOS) && !os(visionOS)
/**
* Smoke Tests profiling via PrivateSentrySDKOnly. Actual profiling unit tests are done elsewhere.
*/
Expand Down Expand Up @@ -349,6 +349,7 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
#endif

#if canImport(UIKit)
#if SENTRY_TARGET_REPLAY_SUPPORTED
func testCaptureReplayShouldCallReplayIntegration() throws {
guard #available(iOS 16.0, tvOS 16.0, *) else { return }

Expand Down Expand Up @@ -443,6 +444,11 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
XCTAssertTrue(redactBuilder.isRedactContainerClassTestOnly(RedactContainer.self))
}

private func getFirstIntegrationAsReplay() throws -> SentrySessionReplayIntegration {
return try XCTUnwrap(SentrySDKInternal.currentHub().installedIntegrations().first as? SentrySessionReplayIntegration)
}
#endif // SENTRY_TARGET_REPLAY_SUPPORTED

func testAddExtraSdkPackages() throws {
PrivateSentrySDKOnly.addSdkPackage("package1", version: "version1")
PrivateSentrySDKOnly.addSdkPackage("package2", version: "version2")
Expand All @@ -462,10 +468,6 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
}
}

private func getFirstIntegrationAsReplay() throws -> SentrySessionReplayIntegration {
return try XCTUnwrap(SentrySDKInternal.currentHub().installedIntegrations().first as? SentrySessionReplayIntegration)
}

private let VALID_REPLAY_ID = "0eac7ab503354dd5819b03e263627a29"
#endif

Expand Down
Loading
Loading