EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

Can't get displayName with Apple Sign-in #1529

Open Sauvetonbio opened 4 years ago

Sauvetonbio commented 4 years ago

Hello,

We use the latest version of this plugin (10.3.3). When using Apple Sign-in, the Google Auth user displayName is null, we get only the email. Tested on iPhone X real device with NS 6.2.1.

firebase.login({ type: firebase.LoginType.APPLE, // Optional appleOptions: { scopes: ["email", "name"] } }).then( function (result) { console.log(result); }, function (errorMessage) { console.log(errorMessage); } );

cvlos commented 4 years ago

Hello! Are you still experiencing the same issue? @Sauvetonbio I am also passing both the "email" and "name" but in the response, I only get the email information.

manojdcoder commented 4 years ago

This seems related to firebase/firebase-ios-sdk/issues/4393

cvlos commented 4 years ago

Thanks for the link @manojdcoder ! Yea totally related. It mentioned that:

Apple only shares user information such as the display name with apps the first time a user signs in. Usually, Firebase stores the display name the first time a user signs in with Apple, which you can get with Auth.auth().currentUser.displayName. However, if you previously used Apple to sign a user in to the app without using Firebase, Apple will not provide Firebase with the user's display name.

Which is true in my case. I will make some modifications this weekend and reply if removing some of the permissions and treating the app as new works.

Sunrise17 commented 4 years ago

After success of authorization via AppleID, authResult!.user.displayName returns nil. Is there some development regarding to this issue?

manojdcoder commented 4 years ago

Please check the comment above, looks like not a plugin issue.

bergerbyte commented 4 years ago

Thanks for the link @manojdcoder ! Yea totally related. It mentioned that:

Apple only shares user information such as the display name with apps the first time a user signs in. Usually, Firebase stores the display name the first time a user signs in with Apple, which you can get with Auth.auth().currentUser.displayName. However, if you previously used Apple to sign a user in to the app without using Firebase, Apple will not provide Firebase with the user's display name.

Which is true in my case. I will make some modifications this weekend and reply if removing some of the permissions and treating the app as new works.

@cavalos0086 does it work for you now? I have the same issue, even with the first login with apple I don't get a user name.

rpragesh commented 3 years ago

@cavalos0086 @Sauvetonbio did you found a workaround for this issue? I am facing the same