HomeiOS Developmentios - Error "Help for an auth supplier with identifer 'apple.com' shouldn't...

ios – Error “Help for an auth supplier with identifer ‘apple.com’ shouldn’t be applied ” in flutter


Error “Help for an auth supplier with identifer ‘apple.com’ shouldn’t be applied ” in flutter when use apple signing with firebase

i’m utilizing
sign_in_with_apple: ^4.3.0
this bundle for the apple signin.

UI picture

enter image description here

when click on apple sign up button then present like this

enter image description here

however when choose share title and e-mail and click on proceed with password.
then present this error on the console.

enter image description here

my code

button

ElevatedButton( onPressed: () {
  handleAppleSignIn();
}, little one: Textual content(
  "apple signin"
)),

handleAppleSignIn() methodology

Future handleAppleSignIn() async {
    last sp = context.learn<SignInProvider>();
    last ip = context.learn<InternetProvider>();
    await ip.checkInternetConnection();

    if (ip.hasInternet == false) {
      openSnackbar(context, 'Verify your Web connection', Colours.pink);
      appleController.reset();
    } else {
      await sp.signInWithAppleID().then((worth) {
        if (sp.hasError == true) {
          openSnackbar(context, sp.errorCode.toString(), Colours.white);
          appleController.reset();
        } else {
          // checking whether or not person exists or not
          sp.checkUserExists().then((worth) async {
            if (worth == true) {
              // person exists
              await sp.getUserDataFromFirestore(sp.uid).then((worth) => sp
                  .saveDataToSharedPreferences()
                  .then((worth) => sp.setSignIn().then((worth) {
                appleController.success();
                handleAfterSignIn();
              })));
            } else {
              // person doesn't exist
              sp.saveDataToFirestore().then((worth) => sp
                  .saveDataToSharedPreferences()
                  .then((worth) => sp.setSignIn().then((worth) {
                googleController.success();
                handleAfterSignIn();
              })));
            }
          });
        }
      });
    }
    //login operate
  }

apple signin methodology

signInWithAppleID()

  Future signInWithAppleID() async {
    last appleIdCredential = await SignInWithApple.getAppleIDCredential(
      scopes: [
        AppleIDAuthorizationScopes.email,
        AppleIDAuthorizationScopes.fullName,
      ],
    );
    last oAuthProvider = OAuthProvider('apple.com');
    last credential = OAuthCredential(
      providerId: oAuthProvider.providerId,
      accessToken: appleIdCredential.authorizationCode,
      idToken: appleIdCredential.identityToken,
      signInMethod: 'apple.com',
    );
    strive {
      // signing to firebase person occasion
      last Person userDetails =
      (await firebaseAuth.signInWithCredential(credential)).person!;

      _email = userDetails.e-mail;
      _uid = userDetails.uid;
      _displayName = userDetails.displayName;

      notifyListeners();
    } on FirebaseAuthException catch (e) {
      change (e.code) {
        case 'account-exists-with-different-credential':
          _errorCode="You have already got an account with us. Use appropriate supplier (Apple)";
          _hasError = true;
          notifyListeners();
          break;

        case 'not chosen':
          _errorCode="Some surprising error whereas making an attempt to sign up with Apple";
          _hasError = true;
          notifyListeners();
          break;
        default:
          _errorCode="Error signing in with Apple: ${e.toString()}";
          _hasError = true;
          notifyListeners();
      }
    }
  }

the best way to resolve this error and repair it ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments