Skip to content

Commit

Permalink
Add conditional compilation to support both Swift 5 and 6 language mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tp committed Sep 26, 2024
1 parent 875bbb5 commit 711c1c8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ jobs:
os: [macos-13, macos-14]
package: [sign_in_with_apple/sign_in_with_apple]
xcode: ["14.3.1", "15.2", "16.0"]
flutter: ["3.19.1"]
flutter: ["3.19.1", "3.24.3"]
exclude:
- os: macos-13
xcode: 14.3.1
- os: macos-13
xcode: 16.0
- flutter: 3.19.1
xcode: 16.0
- flutter: 3.19.1
xcode: 16.0
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public enum SignInWithAppleError {
// 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)
case .notInteractive:
errorCode = "authorization-error/notInteractive"
#endif
#if (os(iOS) && swift(>=6.0)) || (os(macOS) && swift(>=6.0.0))
case .matchedExcludedCredential:
errorCode = "authorization-error/matchedExcludedCredential"
#endif
@unknown default:
print("[SignInWithApplePlugin]: Unknown authorization error code: \(code)");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import UIKit
import Flutter


#if (os(iOS) && swift(>=6.0)) || (os(macOS) && swift(>=6.0.0))
@main
#else
@UIApplicationMain
#endif
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sign_in_with_apple
description: Flutter bridge to initiate Sign in with Apple (on iOS, macOS, and Android). Includes support for keychain entries as well as signing in with an Apple ID.
version: 6.1.2
version: 6.1.3-dev1
homepage: https://github.com/aboutyou/dart_packages/tree/master/packages/sign_in_with_apple
repository: https://github.com/aboutyou/dart_packages

Expand Down

0 comments on commit 711c1c8

Please sign in to comment.