目前我正在使用react-native-facebook-account-kit来验证我的原生应用的电话号码。在这个插件中有一个名为loginWithPhone()的方法,它生成输入和验证UI。因此,我无法控制用户输入其手机号码的字段。如何在用户输入或验证后获取手机号码?
答案 0 :(得分:1)
是的,在RNAccountKit.configure()中,将responseType更改为“ code”
答案 1 :(得分:0)
这对我有用!
RNAccountKit.loginWithPhone()
.then((code) => {
if (!code) {
console.log('Login cancelled')
} else {
this._showMessage("Logged with phone. Token: "+JSON.stringify(code) );
RNAccountKit.getCurrentAccount()
.then((account) => {
console.log("Current account:"+ JSON.stringify(account))
})
}
});