Skip to content

chore(tests): migrate to Swift Package Manager - #699

Draft
demolaf wants to merge 2 commits into
mainfrom
chore/spm-migration
Draft

demolaf wants to merge 2 commits into
mainfrom
chore/spm-migration

Conversation

@demolaf

@demolaf demolaf commented Sep 15, 2026

Copy link
Copy Markdown
Member

No description provided.

bjrochem72 and others added 2 commits September 15, 2026 10:04
* feat(ui_oauth_google)!: migrate to google_sign_in 7

Migrates GoogleProvider to the google_sign_in 7 API, which adopts the
UIScene lifecycle on iOS (google_sign_in_ios 6.3.0) and Swift Package
Manager (6.3.3). Fixes the deprecated application lifecycle warning
tracked in #673.

- GoogleSignIn is now the shared instance and is initialized once
  before the first sign-in.
- Authentication and authorization are separate steps. The provider
  reuses an existing authorization for the requested scopes and prompts
  for consent when one is not available, so the credential still
  carries an access token when scopes are requested.
- A cancelled sign-in surfaces as AuthCancelledException, matching the
  previous flow reset behaviour.
- Adds an optional serverClientId parameter to GoogleProvider,
  GoogleSignInButton and GoogleSignInIconButton for Android apps that
  do not use google-services.json.
- Updates the integration test mocks to the new API.

BREAKING CHANGE: consumers must follow the google_sign_in 7 platform
integration steps: GIDClientID in Info.plist on iOS, and on Android a
web OAuth client entry in google-services.json or an explicit
serverClientId. When no scopes are requested the credential now
contains only an ID token.

* refactor(ui_oauth_google): simplify init and isolate it in tests

Chain the retry-reset catchError directly onto initialize() instead of
threading an intermediate local, and add a @VisibleForTesting
debugReset() that clears the static one-time-init future so each test
starts from a clean state with its freshly injected mock.

Addresses review feedback on #689.

* chore(ui_oauth_google): format provider.dart
Enables SPM for the tests app and drops the CocoaPods-only FirebaseFirestore fork override, which upstream firebase-ios-sdk makes redundant by shipping Firestore as a precompiled binaryTarget over SPM.

Two fixes were needed to make SPM resolve and build. firebase_database floated to 12.6.0, whose Package.swift pins firebase-ios-sdk with exact: 12.19.0 while firebase_core pins exact: 12.18.0, which SPM cannot reconcile; it is now pinned to 12.5.0. The Runner target's IPHONEOS_DEPLOYMENT_TARGET was 13.0, below the 15.0 the Firebase packages require, which CocoaPods masked and SPM enforces.

Package.resolved is gitignored alongside Podfile.lock to match the repo's existing lockfile convention.

iOS and macOS both build. Still WIP: the firebase_ui_auth example app, the dead fork-pin rewriter in scripts/update_dependencies.dart, and the e2e.yml Pods caches are untouched, and desktop_webview_auth and twitter_login still force hybrid CocoaPods mode until #693 and #697 land. The AppDelegate/Info.plist changes are Flutter 3.44's unrelated UIScene migration and should be split out before this is ready.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the google_sign_in dependency to version 7.1.0, which includes significant changes to the initialization and authentication flow. It introduces serverClientId support, updates the GoogleProvider to use the new authenticate method, and updates test suites to accommodate these changes. Additionally, it enables Swift Package Manager for iOS and macOS projects and updates the firebase_database dependency. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants