Skip to content

Commit

Permalink
fix: add missing switch cases and update compiler check
Browse files Browse the repository at this point in the history
  • Loading branch information
juliansteenbakker committed Jan 17, 2025
1 parent d237563 commit 2c4aadf
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,21 @@ public enum SignInWithAppleError {
errorCode = "authorization-error/notHandled"
case .failed:
errorCode = "authorization-error/failed"
#if (os(iOS) && swift(>=5.5)) || (os(macOS) && swift(>=5.5.1))
#if compiler(>=5.5)
// new case since Xcode 13, arrived earlier in iOS
// use https://swiftly.dev/swift-versions to match Swift to Xcode versions (as this is in practice driven by the OS SDK, not Swift version)
// use https://xcodereleases.com/ to match Swift to Xcode versions (as this is in practice driven by the OS SDK, not Swift version)
case .notInteractive:
errorCode = "authorization-error/notInteractive"
#endif
#if compiler(>=6.0)
case .matchedExcludedCredential:
errorCode = "authorization-error/matchedExcludedCredential"
#endif
#if compiler(>=6.0.3)
case .credentialImport:
errorCode = "authorization-error/credentialImport"
case .credentialExport:
errorCode = "authorization-error/credentialExport"
#endif
@unknown default:
print("[SignInWithApplePlugin]: Unknown authorization error code: \(code)");
Expand Down

0 comments on commit 2c4aadf

Please sign in to comment.