Skip to content

Commit

Permalink
chore: added conditional blocks for visionOS as required
Browse files Browse the repository at this point in the history
  • Loading branch information
desusai7 committed Jul 4, 2024
1 parent 88ef7f5 commit de437dc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Auth0.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Pod::Spec.new do |s|
s.version = '2.8.0'
s.summary = "Auth0 SDK for Apple platforms"
s.description = <<-DESC
Auth0 SDK for iOS, macOS, tvOS, and watchOS apps.
Auth0 SDK for iOS, macOS, tvOS, watchOS and visionOS apps.
DESC
s.homepage = 'https://github.com/auth0/Auth0.swift'
s.license = 'MIT'
Expand Down
2 changes: 2 additions & 0 deletions Auth0/Telemetry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public struct Telemetry {
return "tvOS"
#elseif os(watchOS)
return "watchOS"
#elseif os(visionOS)
return "visionOS"
#else
return "unknown"
#endif
Expand Down
4 changes: 2 additions & 2 deletions Auth0Tests/CredentialsManagerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ class CredentialsManagerSpec: QuickSpec {
}
}
}

#if os(iOS)
nti
#if os(iOS) || os(visionOS)
context("require biometrics") {

it("should error when biometrics are unavailable") {
Expand Down
4 changes: 4 additions & 0 deletions Auth0Tests/TelemetrySpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class TelemetrySpec: QuickSpec {
expect(env["tvOS"]).toNot(beNil())
#elseif os(watchOS)
expect(env["watchOS"]).toNot(beNil())
#elseif os(visionOS)
expect(env["visionOS"]).toNot(beNil())
#else
expect(env["unknown"]).toNot(beNil())
#endif
Expand Down Expand Up @@ -104,6 +106,8 @@ class TelemetrySpec: QuickSpec {
expect(env["tvOS"]).toNot(beNil())
#elseif os(watchOS)
expect(env["watchOS"]).toNot(beNil())
#elseif os(visionOS)
expect(env["visionOS"]).toNot(beNil())
#else
expect(env["unknown"]).toNot(beNil())
#endif
Expand Down
4 changes: 2 additions & 2 deletions Auth0Tests/WebAuthSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class WebAuthSpec: QuickSpec {
#endif

#if compiler(>=5.10)
if #available(iOS 17.4, macOS 14.4, *) {
if #available(iOS 17.4, macOS 14.4, visionOS 1.2, *) {
context("https") {
it("should build with the domain") {
expect(newWebAuth().useHTTPS().redirectURL?.absoluteString) == "https://\(Domain)/\(platform)/\(bundleId)/callback"
Expand Down Expand Up @@ -485,7 +485,7 @@ class WebAuthSpec: QuickSpec {

}

#if os(iOS)
#if os(iOS) || os(visionOS)
describe("login") {

var auth: Auth0WebAuth!
Expand Down
4 changes: 3 additions & 1 deletion Auth0Tests/WebAuthSpies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SpyTransaction: AuthTransaction {

}

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit
import SafariServices

Expand All @@ -66,7 +66,9 @@ class SpyViewController: UIViewController {
}

}
#endif

#if os(iOS)
class SpySafariViewController: SFSafariViewController {

var isPresented = false
Expand Down

0 comments on commit de437dc

Please sign in to comment.