skip to Main Content

I has published an app on Apple store et was. surprised that authentication by phone number caused an error on Ios/IPHONE devices.

My Application is developper with flutter .
Authentication works fine for Android devices.
Also when using phone number of an Iphone device on an Android device, tha Iphone receive well the OTP.

When authentication is made by Iphone, an error occured (Firebase)

10.18.0 – [FirebaseAuth][I-AUT000018] Error getting App Check token; using placeholder token instead. Error: Error Domain=com.google.app_check_core Code=0 "The server responded with an error:

All configuration is done on Firebase console and Apple developper account (certificates, keys …)

I have read many suggested solutions on the web, but no luck.
Can someone help please.

Thanks in advance.

ADDED MY CODE :

_verifyPhoneButton(String phone) async {
final auth = FirebaseAuth.instance;

await firebaseAuth.verifyPhoneNumber(
    phoneNumber: phone,
    timeout: const Duration(seconds: 120),

    verificationCompleted: (AuthCredential  phoneAuthCredential) async {
      firebaseAuth.signInWithCredential(auth as AuthCredential)
          .then((result) =>{
        if(result != null && result.user != null){
          print("Authentication is Successful")
        }else{
          print("Authentication failed!")
        }
      }).catchError((error){
        print("Authentication failed!");
      });
    },
    verificationFailed: (verificationFailed) async {
      await showDialog(
          context: context,
          barrierDismissible: false,
          builder: (BuildContext context) => CupertinoAlertDialog(
                title: Text("Erreur: ${AppLocalizations.of(this.context)!.inscription}", style: styles.labelTextBoldColor(context, 18)),
                content: Text(verificationFailed.message!, style: styles.labelTextColor(context, 13)),
                actions: <Widget>[
                  CupertinoDialogAction(
                    child: Text(
                      AppLocalizations.of(this.context)!.compris,
                      style: styles.labelTextColor(context, 13),
                    ),
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                  ),
                ],
              ));
    },
    codeSent: (verificationId, resendingToken) async {
      verificationIDFromFirebase = verificationId;
      //print("TIME OUT $verificationId");
    },
    codeAutoRetrievalTimeout: (verificationId) async {
      //print("TIME OUT");
    });

}

2

Answers


  1. Chosen as BEST ANSWER

    Resolved, All configurations are OK except in google messaging for APNS key the team ID was automatically detected and was wrong, corrected it, the error gone and all works fine.


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