Using swift.
iOS version 10.2.
Firebase SDK version: 3.14.0
FirebaseUI version: 2.0.0
CocoaPods Version: 1.2
I have enabled FB and login by email. Email logins created just fine. UI asks for Display Name but is not returning the display name when I try to get it with FIRAuth.auth()?.currentUser?.displayName
I'm expecting the displayName collected from the UI to be returned.
@vamshire I can't reproduce the issue. Can you please:
FIRUser from FIRAuthStateDidChangeListenerHandle.Closing due to inactivity, @vamshire feel free to reopen this issue if it's still relevant.
Also with the latest SDK this is relevant:
the user object is returning this:
{ email: '[email protected]',
metadata:
{ createdAt: 2017-05-29T08:23:44.000Z,
lastSignedInAt: 2017-05-29T08:23:44.000Z },
uid: 'Rw6XI2uhQXEn5yzdchvhbXI42' }
displayName is not set directly after signup?
Can we reopen this issue? I'm having the same problem. When I call displayName on the Firebase user after sign up, it is null despite me providing one. Email is present so I don't understand why displayName is not. Thanks.
Closing this, as it has staled. If you still have this issue, please file it over at the main Firebase iOS repo.
still having this issue in swift 4. very easy to reproduce for me
Auth.auth().signIn(withEmail: email, password: pass)
{ (user, error) in
if let u = user
{
print("my display name is (u.displayName) ")
}
})
This sounds like an upstream FirebaseAuth issue. @manmanmaaaaan what versions of Firebase/FirebaseUI are you using?
thnx.I am using FireBaseAuth 4.6.1I have swift 4 and xcode 9.3Auth.auth().signIn(withEmail: $email, $password: pass){ (user, error) in聽 聽 聽 聽 聽 聽 聽 聽 聽聽 if let e = error聽 {聽 聽 let t = text_from_error_code(e._code)聽 聽 alert(t, msg: e.localizedDescription, done:nil)聽 }聽 else if let u = user聽 {聽 聽 print("name is (u.displayName)")聽 }聽 else聽 {聽 聽 聽alert("Hmm", msg:"No error, but could not log you in.", done:nil)聽 }
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #000000; background-color: #ffffff}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #d12f1b; background-color: #ffffff}
span.s1 {color: #ba2da2}
span.s2 {color: #000000}
})I am seeing under my admin panel, in cloud firestore database under the 'users' collection, my name under the field 'displayName'
-------- Original Message --------
Subject: Re: [firebase/FirebaseUI-iOS] call to displayName after Email
signup is returning Nil (#262)
From: Morgan Chen notifications@github.com
Date: Thu, April 26, 2018 11:25 am
To: firebase/FirebaseUI-iOS FirebaseUI-iOS@noreply.github.com
Cc: manmanmaaaaan ian@trueframe.com, Mention
mention@noreply.github.com
This sounds like an upstream FirebaseAuth issue. @manmanmaaaaan what versions of Firebase/FirebaseUI are you using? 鈥擸ou are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
under firebase 'Authentication' (not database) - I do find my user, but there is no way to set displayName, if I am supposed to set displayName there?? instead of under database, with collection 'users' ?
Any update on this ? FirebaseUI email provider is creating user without name, even though its part of the wizard.
@radvansky-tomas what versions of Firebase/FirebaseUI are you using?
Still reproduces with versions:
Firebase 5.14.0,
FirebaseUI 5.2.2
The steps to reproduce are:
Auth.auth().addStateDidChangeListener is called neither FIRUser *_Nullable user nor Auth.auth().currentUser returns valid displayName.Even though user instance is not nil, displayName is nil.
@morganchen12 Can you please take a look, thanks!
@dmsl1805 are you using a provider with a display name?
@dmsl1805 are you using a provider with a display name?
I try to get a name from either Auth.auth().currentUser or user instance inside Auth.auth().addStateDidChangeListener listener block.
Also I check providerData set from user and displayName in FIRUserInfo was also nil.
Here is and example of how I use it:
FUIAuth.defaultAuthUI()?.delegate = self
FUIAuth.defaultAuthUI()?.providers = [FUIGoogleAuth(), FUIFacebookAuth()]
let authSubscribtion = Auth.auth().addStateDidChangeListener { _, user in
// Here user.displayName is nil, the same for Auth.auth().currentUser.displayName
}
I see, that's a duplicate of #561.
FYI, this is not only a duplicate of #561. The original issue is correct: displayName on the user is nil in the FIRAuthStateDidChangeListenerHandle callback after creating an user via FUIEmailAuth.
The user is created just fine. In fact, sometime afterward displayName gets populated on the same FIRUser object (maybe after some kind of async networking).
Most helpful comment
Can we reopen this issue? I'm having the same problem. When I call
displayNameon the Firebase user after sign up, it is null despite me providing one. Email is present so I don't understand why displayName is not. Thanks.