How to update profile (displayName) firebase in React Native?
up vote
0
down vote
favorite
I found a problem to update profile firebase in React Native, I try to look for example but fails all, maybe you can give me advices or you can correct my script.
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then(
(user)=>
if(user)
user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
I try to follow all examples, in the alert shows message 'user.updateProfile is not a function'.
Please anyone help me how to update profile (displayName) firebase in React Native.
Thanks.
javascript firebase react-native firebase-authentication
add a comment |
up vote
0
down vote
favorite
I found a problem to update profile firebase in React Native, I try to look for example but fails all, maybe you can give me advices or you can correct my script.
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then(
(user)=>
if(user)
user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
I try to follow all examples, in the alert shows message 'user.updateProfile is not a function'.
Please anyone help me how to update profile (displayName) firebase in React Native.
Thanks.
javascript firebase react-native firebase-authentication
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I found a problem to update profile firebase in React Native, I try to look for example but fails all, maybe you can give me advices or you can correct my script.
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then(
(user)=>
if(user)
user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
I try to follow all examples, in the alert shows message 'user.updateProfile is not a function'.
Please anyone help me how to update profile (displayName) firebase in React Native.
Thanks.
javascript firebase react-native firebase-authentication
I found a problem to update profile firebase in React Native, I try to look for example but fails all, maybe you can give me advices or you can correct my script.
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then(
(user)=>
if(user)
user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
I try to follow all examples, in the alert shows message 'user.updateProfile is not a function'.
Please anyone help me how to update profile (displayName) firebase in React Native.
Thanks.
javascript firebase react-native firebase-authentication
javascript firebase react-native firebase-authentication
edited 2 days ago
Frank van Puffelen
217k25361385
217k25361385
asked 2 days ago
Frank Andrew
265
265
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The createUserWithEmailAndPassword
method returns a UserCredential
object. This is not a User
itself, but has a user
property, which is a User
object.
So what you need it:
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then((userCredentials)=>
if(userCredentials.user)
userCredentials.user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The createUserWithEmailAndPassword
method returns a UserCredential
object. This is not a User
itself, but has a user
property, which is a User
object.
So what you need it:
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then((userCredentials)=>
if(userCredentials.user)
userCredentials.user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
add a comment |
up vote
0
down vote
The createUserWithEmailAndPassword
method returns a UserCredential
object. This is not a User
itself, but has a user
property, which is a User
object.
So what you need it:
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then((userCredentials)=>
if(userCredentials.user)
userCredentials.user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
add a comment |
up vote
0
down vote
up vote
0
down vote
The createUserWithEmailAndPassword
method returns a UserCredential
object. This is not a User
itself, but has a user
property, which is a User
object.
So what you need it:
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then((userCredentials)=>
if(userCredentials.user)
userCredentials.user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
The createUserWithEmailAndPassword
method returns a UserCredential
object. This is not a User
itself, but has a user
property, which is a User
object.
So what you need it:
firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
.then((userCredentials)=>
if(userCredentials.user)
userCredentials.user.updateProfile(
displayName: 'Frank S. Andrew'
).then((s)=>
this.props.navigation.navigate('Account');
)
)
.catch(function(error)
alert(error.message);
);
answered 2 days ago
Frank van Puffelen
217k25361385
217k25361385
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
add a comment |
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
ok, it's work for me, Thanks
– Frank Andrew
yesterday
ok, it's work for me, Thanks
– Frank Andrew
yesterday
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
Good to hear Frank. If my answer was useful, click the upvote button (▲) to the left of it. If it answered your question, click the checkmark (✓) to accept it. That way others know that you've been (sufficiently) helped.
– Frank van Puffelen
23 hours ago
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238244%2fhow-to-update-profile-displayname-firebase-in-react-native%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password