Emre Tufekci
Emre Tufekci

Reputation: 157

Flutter Firebase Auth doesn't work from Google Play

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);

Upvotes: 0

Views: 737

Answers (1)

BLKKKBVSIK
BLKKKBVSIK

Reputation: 3548

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

Upvotes: 2

Related Questions