From 6d94760c716b07fba469362de22df3537baa7aee Mon Sep 17 00:00:00 2001 From: Timm Preetz Date: Wed, 25 Sep 2024 12:03:33 +0200 Subject: [PATCH] Add conditional compilation to support both Swift 5 and 6 language mode --- .github/workflows/dart.yml | 13 ++++++++++--- .../darwin/Classes/SignInWithAppleError.swift | 7 +++++++ .../example/ios/Runner/AppDelegate.swift | 5 +++++ .../sign_in_with_apple/pubspec.yaml | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index ffdcae69..0d96c627 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -59,15 +59,22 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-13, macos-14] + os: [macos-13, macos-14, macos-15] 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 + xcode: 15.2 - os: macos-13 xcode: 16.0 + - os: macos-14 + xcode: 16.0 + flutter: 3.19.1 + - os: macos-15 + xcode: 15.2 + - os: macos-15 + xcode: 14.3.1 steps: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 diff --git a/packages/sign_in_with_apple/sign_in_with_apple/darwin/Classes/SignInWithAppleError.swift b/packages/sign_in_with_apple/sign_in_with_apple/darwin/Classes/SignInWithAppleError.swift index 35ea67fa..7451b53b 100644 --- a/packages/sign_in_with_apple/sign_in_with_apple/darwin/Classes/SignInWithAppleError.swift +++ b/packages/sign_in_with_apple/sign_in_with_apple/darwin/Classes/SignInWithAppleError.swift @@ -113,6 +113,13 @@ public enum SignInWithAppleError { case .notInteractive: errorCode = "authorization-error/notInteractive" #endif + + + +// #available(iOS 18.0, *) + case .matchedExcludedCredential: + errorCode = "authorization-error/matchedExcludedCredential" + @unknown default: print("[SignInWithApplePlugin]: Unknown authorization error code: \(code)"); } diff --git a/packages/sign_in_with_apple/sign_in_with_apple/example/ios/Runner/AppDelegate.swift b/packages/sign_in_with_apple/sign_in_with_apple/example/ios/Runner/AppDelegate.swift index 70693e4a..8d3e6de0 100644 --- a/packages/sign_in_with_apple/sign_in_with_apple/example/ios/Runner/AppDelegate.swift +++ b/packages/sign_in_with_apple/sign_in_with_apple/example/ios/Runner/AppDelegate.swift @@ -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, diff --git a/packages/sign_in_with_apple/sign_in_with_apple/pubspec.yaml b/packages/sign_in_with_apple/sign_in_with_apple/pubspec.yaml index e79deeee..65a5dd7f 100644 --- a/packages/sign_in_with_apple/sign_in_with_apple/pubspec.yaml +++ b/packages/sign_in_with_apple/sign_in_with_apple/pubspec.yaml @@ -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