-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
bug: Apple sign-in does not return "displayName" with a fresh user #481
Comments
Like this comment on a similar issue I have a workaround that involves using the capacitor-community/apple-sign-in plugin to get
|
If you use import { FirebaseAuthentication } from '@capacitor-firebase/authentication';
const signInWithApple = async () => {
const result = await FirebaseAuthentication.signInWithApple();
console.log(result.user.displayName);
}; Then you can set it manually in Firebase via |
@robingenz I might be confused on some things. I thought the point of this capacitor plugin was to allow for native looking dialogs to appear for authentication? I am not sure the benefit of native beyond that for my Ionic Vue app as I don't do anything else native. However, getting the name and email of the user is extremely important. If I have to append their name with a DB update and/or However, I will show you tomorrow on our call that the plugin does not return the display name unfortunately. I've been saving all the JSON outputs in various states. But I'm hoping it's user error! |
@tylerclark Good news! I tried again with
Feel free to give it a try. Please note that you still need to call |
@robingenz I've tested on iOS and verify it works. This is my code now:
|
Great, thanks for testing! In this case I will merge the PR. |
Plugin(s)
Did you test the latest version?
Platform(s)
Current behavior
Note: I know you only get the
displayName
of the user the FIRST time you authenticate with Apple. I went to https://appleid.apple.com/account/manage and removed my app from the list under "Sign in with Apple" and also removed my user from Firebase Auth/Firestore.When I try to run this method...
...I do not get the
displayName
back. Strangely, when I change this line......I get the
displayName
field and it's stored nicely in firebase but the authentication fails on what I'm guessing is the web layer because I get the error{"code":"auth/missing-or-invalid-nonce","customData":{"appName":"[DEFAULT]"},"name":"FirebaseError"}
and the UI doesn't show them logged in.I can 10000% reproduce this and also show you payloads from the response I get back from Apple. Unless there is something I'm missing I am doing everything as instructed.
Expected behavior
The
displayName
is returned the first time you attempt to loginReproduction
https://github.com/tylerclark/sampleApp
Steps to reproduce
displayName
in the return payloadOther information
Capacitor doctor
Before submitting
The text was updated successfully, but these errors were encountered: