11.4 C
New York
Wednesday, December 18, 2024

ios – firebase_auth/app-verification-failed – The app verification course of has failed


I’ve a flutter undertaking that I am operating on my IOS simulator, and It is built-in to Firebase.

When I attempt to use this perform:

await FirebaseAuth.occasion.verifyPhoneNumber(
    phoneNumber: countryDial +
        numberController.textual content.trim(),
    verificationCompleted:
        (PhoneAuthCredential
            credential) async {
      showSnackBarText(
          'Code Confirmed', context);

      setState(() {
        isCodeSending = false;
      });
      await FirebaseAuth.occasion
          .signInWithCredential(credential);
      userLocation =
          await MyPrefer.getUserLocation();
      await userCheck()
          ? CallApi().updateUserData.add({
              'title': '',
              'secondName': '',
              'electronic mail': '',
              'standing': 'energetic',
              'calledItem': [],
              'phoneNumber': FirebaseAuth
                  .occasion
                  .currentUser!
                  .phoneNumber,
              'userId': FirebaseAuth
                  .occasion.currentUser!.uid,
              'location': userLocation,
            })
          : Container();

      if (widget.isEditPhone == true) {
        CallApi()
            .updateUserData
            .doc(widget.userId)
            .replace({
          'phoneNumber': countryDial +
              numberController.textual content.trim(),
        });
      }
      Navigator.pushAndRemoveUntil(
          context,
          MaterialPageRoute(
              builder:
                  (BuildContext context) =>
                      MyBottomTab(
                        tabNum: 3,
                      )),
          (Route route) => false);
    },
    verificationFailed:
        (FirebaseAuthException e) {
      setState(() {
        isCodeSending = false;
      });
      if (e.code == 'invalid-phone-number') {
        showSnackBarText(
            'Unsuitable telephone quantity, Strive Once more!',
            context);
      }
      if (e.code == 'too-many-requests') {
        showSnackBarText(
            'Too many requests, strive once more later!',
            context);
      } else {
        showSnackBarText(
            'One thing Unsuitable',
            context);
        debugPrint(
            'Cellphone verification error: $e');
        Sentry.captureException(e);
      }
    },
    codeSent: (String verificationID,
        int? resendToken) {
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (context) => MessagePage(
            isEditNumber: widget.isEditPhone,
            userId: widget.userId,
            phoneNumber: countryDial +
                numberController.textual content.trim(),
            verificationId: verificationID,
          ),
        ),
      );
      showSnackBarText(
          'Code Despatched', context);
      setState(() {
        token = resendToken!;
        isCodeSending = false;
      });
    },
    codeAutoRetrievalTimeout:
        (String verificationID) {
      // showSnackBarText(
      //     'Code Expired', context);
    },
    timeout: const Period(seconds: 60));
}

I get the next error:

Cellphone verification error: [firebase_auth/app-verification-failed] The app verification course of has failed

I could not discover anybody writing about this failure code firebase_auth/app-verification-failed


The next is the pubspecs.yaml particulars: sdk: ">=2.16.0-134.1.beta <3.0.0"

  • cupertino_icons: ^1.0.2
  • flutter_svg: ^2.0.1
  • firebase_core: ^2.5.0
  • firebase_database: ^10.0.2
  • image_picker: ^0.8.6+1
  • cloud_firestore: ^4.7.0
  • firebase_storage: ^11.0.6
  • carousel_slider: ^4.1.1
  • firebase_auth: ^4.5.0
  • shared_preferences: ^2.0.15
  • step_progress_indicator: ^1.0.2
  • firebase_remote_config: ^3.0.10
  • webview_flutter: ^4.2.0
  • flutter_inappwebview: ^5.7.2+3
  • permission_handler: ^10.2.0
  • url_launcher: ^6.1.11
  • flutter_image_compress: ^1.1.3
  • flutter_slidable: ^3.0.0
  • sentry_flutter: ^7.5.0
  • firebase_messaging: ^14.6.4
  • intl: ^0.18.0
  • share_plus: ^4.5.3
  • firebase_dynamic_links: ^5.2.0
  • package_info: ^2.0.2
  • photo_view: ^0.14.0
  • country_picker: ^2.0.20
  • cached_network_image: ^3.2.3
  • firebase_app_check: ^0.1.5+1
  • http: ^1.1.0

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles