Skip to content

[google_sign_in] Update iOS to 8.0 to support App Check #166967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
azizirac opened this issue Apr 11, 2025 · 1 comment · Fixed by flutter/packages#9081
Closed

[google_sign_in] Update iOS to 8.0 to support App Check #166967

azizirac opened this issue Apr 11, 2025 · 1 comment · Fixed by flutter/packages#9081
Labels
fyi-ecosystem For the attention of Ecosystem team p: google_sign_in The Google Sign-In plugin package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Comments

@azizirac
Copy link

azizirac commented Apr 11, 2025

Steps to reproduce

  1. Enable AppCheck in Firebase
  2. Make sure AppCheck token is working in other parts. Signup with Email, wit Apple and try multiple things in you app. I use Firestore and other services, all working properly.
  3. Try to signup with Google. A pop-us (safari) shows up and after the login, Google rejects it with a message (see picture)

Expected results

The user should be able to login with Google with App check enabled.

References I found suggest to upgrade the GoogleSignIn to 8.0.0 or higher

google_sign_in is on 7.1

  s.dependency 'AppAuth', '>= 1.7.4'
  s.dependency 'GTMSessionFetcher', '>= 3.4.0'
  s.dependency 'GoogleSignIn', '~> 7.1'

Actual results

Error message from Google

Code sample

Code sample
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';

final _googleSignIn = GoogleSignIn(scopes: ['profile', 'email']);

Future<UserCredential?> googleSignInFunc() async {
  if (kIsWeb) {
    // Once signed in, return the UserCredential
    return await FirebaseAuth.instance.signInWithPopup(GoogleAuthProvider());
  }

  await signOutWithGoogle().catchError((_) => null);
  final auth = await (await _googleSignIn.signIn())?.authentication;
  if (auth == null) {
    return null;
  }
  final credential = GoogleAuthProvider.credential(
      idToken: auth.idToken, accessToken: auth.accessToken);
  return FirebaseAuth.instance.signInWithCredential(credential);
}

Future signOutWithGoogle() => _googleSignIn.signOut();

Screenshots or Video

Image

Logs

Logs
No logs as the login is on Safari
@darshankawar darshankawar changed the title Google singin in iOS missing the AppCheck token Google signin in iOS missing the AppCheck token Apr 11, 2025
@darshankawar darshankawar added in triage Presently being triaged by the triage team platform-ios iOS applications specifically p: google_sign_in The Google Sign-In plugin package flutter/packages repository. See also p: labels. fyi-ecosystem For the attention of Ecosystem team team-ios Owned by iOS platform team and removed in triage Presently being triaged by the triage team labels Apr 11, 2025
@stuartmorgan-g
Copy link
Contributor

It looks like the breaking change in 8.0 was dropping iOS 11 support, which doesn't affect us any more, so it may be trivial to update to 8.0.

@stuartmorgan-g stuartmorgan-g changed the title Google signin in iOS missing the AppCheck token [google_sign_in] Update iOS to 8.0 to support App Check Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fyi-ecosystem For the attention of Ecosystem team p: google_sign_in The Google Sign-In plugin package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants