Bu sorun nasıl çözülür? bu hatanın sebebini ve çözümünü açıkla


apple ile giriş bu şekilde yapılıyor ne yapmalıyım

import React, { useState } from "react";
import { Alert } from "react-native";
import {
  AppleError,
  appleAuth,
} from "@invertase/react-native-apple-authentication";
import CONFIG from "@/core/CONFIG";
import axios from "axios";
import IconButton from "@/components/SigninButtons/IconButton";
import { useRouter } from "expo-router";
import { useSession } from "@/core/session/AuthContext";

async function appleSignInRequest(): Promise<string | null | undefined> {
  try {
    const response = await appleAuth.performRequest({
      requestedOperation: appleAuth.Operation.LOGIN,
      requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL],
    });

    const credentialState = await appleAuth.getCredentialStateForUser(
      response.user,
    );
    if (credentialState !== appleAuth.State.AUTHORIZED) {
      console.log(
        "[Apple Sign In] Authentication failed. Original response: ",
        { response },
      );
      // throw new Error("Authentication failed");
    }

    return response?.identityToken;
  } catch (error) {
    console.log("[Apple Sign In] Request failed:", error);
  }
}

function AppleLoginButton() {
  const [isLoading, setIsLoading] = useState(false);
  const router = useRouter();
  const { signIn } = useSession();

  const handlePress = async () => {
    setIsLoading(true);
    try {
      const token = await appleSignInRequest();
      if (!token) {
        setIsLoading(false);
        return;
      }
      const postData = {
        access_token: token,
        code: token,
      };
      const axiosConfig = {
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json",
        },
      };

      const authToken = await axios.post(
        CONFIG.APPLE_SIGN_IN.WEB_CALLBACK_URL,
        postData,
        axiosConfig,
      );

      if (authToken?.data?.data) {
        await signIn(authToken?.data?.data); // signIn işlemini bekle
        router.replace("/");
      }
    } catch (error: AppleError | any) {
      if (error.code === appleAuth.Error.CANCELED) {
        console.log("[Apple Sign In] İşlem iptal edildi.");
      } else {
        console.error("Apple Sign In failed:", error);
        Alert.alert("Error", error?.response?.data?.message || "Server Error");
      }
    } finally {
      setIsLoading(false);
    }
  };

  if (!appleAuth.isSupported) {
    return null;
  }

  return (
    <IconButton
      onPress={handlePress}
      isLoading={isLoading}
      provider={CONFIG.SIGN_IN_METHOD.APPLE}
      variant="outline"
    />
  );
}

AppleLoginButton.displayName = "AppleLoginButton";

export default AppleLoginButton;

Hello,


Thank you for your resubmission. Upon further review, we identified additional issues that need your attention. See below for more information.


If you have any questions, we are here to help. Reply to this message in App Store Connect and let us know.



Review Environment


Submission ID: 4db5ce-4e8f-9544-de1b60527e61

Review date: November 17, 2024

Version reviewed: 1.0


Guideline 4.0 - Design


Your app offers Sign in with Apple as a login option but does not follow the design and user experience requirements for Sign in with Apple. Specifically:


- Your app requires users to provide their name and/or email address after using Sign in with Apple. This information is already provided by the Authentication Services framework.



These requirements provide the consistent experience users expect when using Sign In with Apple to authenticate or log in to an account.


Next Steps


Please revise the Sign in with Apple experience in your app to address the issues we identified above.


Resources


- To learn more about App Store design requirements, see App Review Guideline 4 - Design.

- For an overview of design and formatting recommendations for Sign in with Apple, review the Human Interface Guidelines.


Support


- Reply to this message in your preferred language if you need assistance. If you need additional support, use the Contact Us module.

- Consult with fellow developers and Apple engineers on the Apple Developer Forums.

- Provide feedback on this message and your review experience by completing a short survey.



The In App Purchase products have been returned to you and will need to be resubmitted with a revised binary. They are currently in a state of “Developer Action Needed”. 


We look forward to reviewing your app once these issues have been addressed and the new build has been received and queued for review.


Please be sure to resubmit any required, previously rejected, or unapproved In App Purchase products along with the revised binary.


Best regards,


App Review