我使用 Facebook 帐户工具包在我的项目中使用电话和电子邮件登录,此登录的响应是一个令牌,但我需要将电话号码和电子邮件保存在我的数据库中,如何获取用于登录的用户电子邮件电话?
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." });
}
}
用户成功登录后可以获取帐户信息
// Retrieves the logged user account info, if any user is logged
RNAccountKit.getCurrentAccount()
.then((account) => {
console.log(`Current account: ${account}`)
})