Skip to content

Commit

Permalink
fix: disable compilation of code on platforms which do not support it
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriyVasyk committed Sep 2, 2024
1 parent 5f45119 commit 8ec4278
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ extension LAContext {
switch policy {
case .authentication:
localPolicy = .deviceOwnerAuthentication
case .watch:
localPolicy = .deviceOwnerAuthenticationWithWatch
case .biometrics:
localPolicy = .deviceOwnerAuthenticationWithBiometrics
#if os(macOS)
case .watch:
localPolicy = .deviceOwnerAuthenticationWithWatch
case .biometricsOrWatch:
localPolicy = .deviceOwnerAuthenticationWithBiometricsOrWatch
#endif
}

return self.canEvaluatePolicy(localPolicy, error: error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public enum LocalAuthenticationPolicy: Int {
/// Device owner will be authenticated by biometry or user password.
case authentication = 2

#if os(macOS)
/// Device owner will be authenticated by Apple Watch.
case watch = 3

/// Device owner will be authenticated by biometry or Apple Watch.
case biometricsOrWatch = 4
#endif
}

0 comments on commit 8ec4278

Please sign in to comment.