So I am using ParseUI to login with AppleID. Everything works great, except I cannot seem to get the email address. I have looked at the Poarse code and it seems to be requesting it. I also see the box checked in the login dialog apple provides when I perform the login.
However, the PFUser Object shows the email as nil. It does populate username.
Here is some code:
extension OnboardViewController: PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate
{
// LogInViewController Delegate Methods
@available(iOS 13.0, *)
func log(_ logInController: PFLogInViewController, didReceiveAppleCredential credential: ASAuthorizationAppleIDCredential, for user: PFUser)
{
print("didReceiveAppleCredential")
}
func log(_ logInController: PFLogInViewController, didLogIn user: PFUser)
{
print("didLogIn")
if #available(iOS 13.0, *)
{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let mainTabBarController = storyboard.instantiateViewController(identifier: "MainTabBarController")
// This is to get the SceneDelegate object from your view controller then call the change root view controller function to change to main tab bar
(UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate)?.changeRootViewController(mainTabBarController)
}
else
{
// Fallback on earlier versions
print("Earlier Vers")
(UIApplication.shared.delegate as! AppDelegate).switchRootViewToHome()
}
}
}
If I set a breakpoint at either of the functions above and check the PFUser username and email, the email always show nil. The user name is populated and the user DB shows the same.
Is there something special I need to do to get the email address?