-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign in With Apple does not contain a DisplayName #10306
Labels
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Thanks, this PR: #10068 should solve the issue |
A video explaining how to update the display name is going live tomorrow. In the meantime, check out this code snippet (source: https://bit.ly/SiwA-updateDisplayName): func updateDisplayName(for user: User, with appleIDCredential: ASAuthorizationAppleIDCredential, force: Bool = false) async {
if let currentDisplayName = Auth.auth().currentUser?.displayName, !currentDisplayName.isEmpty {
// current user is non-empty, don't overwrite it
}
else {
let changeRequest = user.createProfileChangeRequest()
changeRequest.displayName = appleIDCredential.displayName()
do {
try await changeRequest.commitChanges()
self.displayName = Auth.auth().currentUser?.displayName ?? ""
}
catch {
print("Unable to update the user's displayname: \(error.localizedDescription)")
errorMessage = error.localizedDescription
}
}
} |
Based on the comments, this seems to be fixed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
When using Sign In With Apple, following this guide, I don't have access to the display name which is always null even if I properly added the scope for accessing the name.
I properly verified that this is the first time this user is Sign In with Apple.
First reported here: firebase/flutterfire#9662
Reproducing the issue
The
authorization
object does contain the family name and the given name, but theFIRAuthDataResult *_Nullable authResult
has an empty displayNameFirebase SDK Version
9.6.0
Xcode Version
Version 14.0.1
Installation Method
CocoaPods
Firebase Product(s)
Authentication
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetReplace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: