Search code examples
appstore-approval

Apple sign in rejection


I have uploaded an app with Apple SignIn, In that after sign in success we are taking user info like First name, Last name , email But i got a rejection from apple .

  1. 1.1 Legal: Privacy - Data Collection and Storage Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage We noticed that your app requires users to register with personal information that is not directly relevant to your app's core functionality. Specifically, the following fields are required but do not appear to be directly relevant to your app's core functionality:
    • First and Last Name (when using Sign In with Apple)
    • Email (when using Sign In with Apple) Name and Email are supplied by Sign In with Apple, so asking for these separately is not appropriate. We encourage you to utilize Sign In with Apple and honor its intentions, to respect users privacy and personal information. Next Steps To resolve this issue, please either remove all required fields that are not relevant to the app or make those fields optional. Information requested during registration must be relevant to the features the app provides.

Solution

  • *Save all the data in keychain When you get the success data didCompleteWithAuthorization and after use keychain data.

     func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
        if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
    
            // Create an account in your system.
            // For the purpose of this demo app, store the these details in the keychain.
            KeychainItem.currentUserIdentifier = appleIDCredential.user
            KeychainItem.currentUserFirstName = appleIDCredential.fullName?.givenName
            KeychainItem.currentUserLastName = appleIDCredential.fullName?.familyName
            KeychainItem.currentUserEmail = appleIDCredential.email
    
            print("User Id - \(appleIDCredential.user)")
            print("User Name - \(appleIDCredential.fullName?.description ?? "N/A")")
            print("User Email - \(appleIDCredential.email ?? "N/A")")
            print("Real User Status - \(appleIDCredential.realUserStatus.rawValue)") 
    }
    }
    

    For changing any state of credentials you can track with the following code.

     let appleIDProvider = ASAuthorizationAppleIDProvider()
    appleIDProvider.getCredentialState(forUserID: KeychainItem.currentUserIdentifier) { (credentialState, error) in
        switch credentialState {
        case .authorized:
            // The Apple ID credential is valid.
            break
        case .revoked:
            // The Apple ID credential is revoked.
            break
        case .notFound:
            // No credential was found, so show the sign-in UI.
            }
        default:
            break
        }
    }