苹果登录被拒绝

Apple sign in rejection

我已经上传了一个带有 Apple SignIn 的应用程序,在成功登录后我们正在获取用户信息,如名字、姓氏、电子邮件但是我被苹果拒绝了。

  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.

*将所有数据保存在keychain 获取成功数据didCompleteWithAuthorization后使用keychain数据。

 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)") 
}
}

要更改凭据的任何状态,您可以使用以下代码进行跟踪。

 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
    }
}