skip to Main Content

I am attempting to send a email sign-in link with Flutter/Firebase. I have followed the steps in this link, however when I run the sendSignInLinkToEmail an error is thrown with this Object: enter image description here.

  FutureOr<void> emailErrorHandler(Object error) {
    log('Error sending login email: $error');
  }

  FutureOr<void> emailSent(value) {
    log('Successfully sent email, value: $value');
  }

  void clickLogin() {
    ActionCodeSettings actionCodeSettings = ActionCodeSettings(
        url: 'https://www.politicsthegame.app',
        handleCodeInApp: true,
        iOSBundleId: 'com.politicalfun.politicsthegame',
        androidPackageName: 'com.politicalfun.politicsthegame',
        androidInstallApp: true,
        androidMinimumVersion: '12');
    FirebaseAuth.instance
        .sendSignInLinkToEmail(
            email: emailController.text, actionCodeSettings: actionCodeSettings)
        .then(emailSent)
        .catchError(emailErrorHandler);
  }

I have followed all of the advice given in this thread to no avail. I checked that my keys were not restricted in the google cloud console. I verified that I had email link enabled in the firebase console. I deleted the simulators and made a new one. I checked that the api keys in firebase_options, google-service.json, and GoogleService-Info.plist were the same. I’m stumped on where to go next. It would be nice if there was a more descriptive error code

2

Answers


  1. That error indicates that you are hitting the quota limits for OTP. Upgrading to Firebase Auth with Identity Platform is the recommended way to avoid these types of quota errors and prevent abuse. There is a generous free tier so if you were not hitting the quota limits before then most of your requests will be at no cost. See auth limits docs for more.

    Reference: https://groups.google.com/g/firebase-talk/c/Qv2GRqGuW1s/m/BrjtwyKwAQAJ

    Login or Signup to reply.
  2. Try enabling Dynamic Links in your Firebase Project’s console

    I had the same issue and even though it’s counter intuitive, I fixed it thanks to this Github issue

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search