0

I've firebase auth services in my flutter app. It's working on emulator & real device (while debug). But when i publish it on google play neither alpha test or release version it doesn't work.

Main.dart

        StreamProvider(
      create: (context) => context.read<AuthenticationService>().authStateChanges,
    )

AuthService

  final FirebaseAuth _firebaseAuth;
  AuthenticationService(this._firebaseAuth);
  AccessToken accessToken;
  Stream<User> get authStateChanges => _firebaseAuth.idTokenChanges();

SignedIn Method in AuthService

  Future<String> signIn({String email, String password}) async {
    try {
      await _firebaseAuth.signInWithEmailAndPassword(email: email, password: password);
      String uid = await FirebaseAuth.instance.currentUser.uid;

      return "Signed in";
    } on FirebaseAuthException catch (e) {
      return e.message;
    }
  }

Login.dart

  var login = await context.read<AuthenticationService>().signIn(email: mailController.text, password: sifreController.text);

1 Answer 1

2

It could be that you forgot to put the Google Play fingerprint into your Firebase App configuration.

If the Google Play fingerprint are not present on your app, there is no way for the user to connect to Firebase services.

You can find your Google play fingerprint into the Setup -> App Signing menu. See the picture below

enter image description here

You should then add them in the android settings of your firebase app.

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

I've signed app (i guess i cannot publish without this step also), and in this page i see some keys - app signing keys *md5 *sha1 *sha256 -upload key certificate *md5 *sha1 *sha256 idk how can i use them. but there is some keys
@EmreTufekci You should copy those keys in Android settings of your Firebase app. I edited my post so you can see where to add the keys.
I were typing this answer, then you edited. While waiting you i figure out. Thank you so much, it was good hint for me :) "@BLKKKBVSIK's answer is correct but i need to add more, i've added debug sha1 to firebase but it's not enough. Go to @BLKKKBVSIK's shared screen copy SHA-1, then go to firebase console - android page add fingerprint and add that SHA-1 also. Then it worked."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.