Reputation: 307
Im using the Facebook Account Kit to login with phone and email in my project, the response from this login is a token, but I need to save the phone number and email in my DB, how can I getting the user email-phone used to login?
componentDidMount() {
RNAccountKit.configure({
responseType: 'code',
initialPhoneCountryPrefix: '+55',
defaultCountry: 'BR',
});
}
emailVerify = async () => {
try {
const token = await RNAccountKit.loginWithEmail();
if (token) {
this.setState({ verification: true });
}
} catch (err) {
this.setState({ error: "Email não verificado." });
}
}
Upvotes: 0
Views: 490
Reputation: 3636
You Can get account info after user logged in successfully
// Retrieves the logged user account info, if any user is logged
RNAccountKit.getCurrentAccount()
.then((account) => {
console.log(`Current account: ${account}`)
})
Upvotes: 1