Skip to content

Commit de437dc

Browse files
committed
chore: added conditional blocks for visionOS as required
1 parent 88ef7f5 commit de437dc

6 files changed

+14
-6
lines changed

Auth0.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.version = '2.8.0'
3434
s.summary = "Auth0 SDK for Apple platforms"
3535
s.description = <<-DESC
36-
Auth0 SDK for iOS, macOS, tvOS, and watchOS apps.
36+
Auth0 SDK for iOS, macOS, tvOS, watchOS and visionOS apps.
3737
DESC
3838
s.homepage = 'https://github.com/auth0/Auth0.swift'
3939
s.license = 'MIT'

Auth0/Telemetry.swift

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public struct Telemetry {
8585
return "tvOS"
8686
#elseif os(watchOS)
8787
return "watchOS"
88+
#elseif os(visionOS)
89+
return "visionOS"
8890
#else
8991
return "unknown"
9092
#endif

Auth0Tests/CredentialsManagerSpec.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ class CredentialsManagerSpec: QuickSpec {
441441
}
442442
}
443443
}
444-
445-
#if os(iOS)
444+
nti
445+
#if os(iOS) || os(visionOS)
446446
context("require biometrics") {
447447

448448
it("should error when biometrics are unavailable") {

Auth0Tests/TelemetrySpec.swift

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class TelemetrySpec: QuickSpec {
5757
expect(env["tvOS"]).toNot(beNil())
5858
#elseif os(watchOS)
5959
expect(env["watchOS"]).toNot(beNil())
60+
#elseif os(visionOS)
61+
expect(env["visionOS"]).toNot(beNil())
6062
#else
6163
expect(env["unknown"]).toNot(beNil())
6264
#endif
@@ -104,6 +106,8 @@ class TelemetrySpec: QuickSpec {
104106
expect(env["tvOS"]).toNot(beNil())
105107
#elseif os(watchOS)
106108
expect(env["watchOS"]).toNot(beNil())
109+
#elseif os(visionOS)
110+
expect(env["visionOS"]).toNot(beNil())
107111
#else
108112
expect(env["unknown"]).toNot(beNil())
109113
#endif

Auth0Tests/WebAuthSpec.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class WebAuthSpec: QuickSpec {
324324
#endif
325325

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

486486
}
487487

488-
#if os(iOS)
488+
#if os(iOS) || os(visionOS)
489489
describe("login") {
490490

491491
var auth: Auth0WebAuth!

Auth0Tests/WebAuthSpies.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SpyTransaction: AuthTransaction {
4949

5050
}
5151

52-
#if os(iOS)
52+
#if os(iOS) || os(visionOS)
5353
import UIKit
5454
import SafariServices
5555

@@ -66,7 +66,9 @@ class SpyViewController: UIViewController {
6666
}
6767

6868
}
69+
#endif
6970

71+
#if os(iOS)
7072
class SpySafariViewController: SFSafariViewController {
7173

7274
var isPresented = false

0 commit comments

Comments
 (0)