Alauddin Ahmed
Alauddin Ahmed

Reputation: 1185

Get mobile number using react-native-facebook-account-kit

Currently im using react-native-facebook-account-kit to verify phone number for my native app. In this plugin there is a method called loginWithPhone() which is generating input and verification UI. So i dont have any control over that fields where users are typing their mobile number. How can i get the mobile number after the user typed it or after verification?

Upvotes: 2

Views: 786

Answers (2)

kishan verma
kishan verma

Reputation: 1000

This work for me!

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))
 })
}
 });

Upvotes: 0

Siddharth
Siddharth

Reputation: 11

Yes, in RNAccountKit.configure(), change responseType to 'code'

Upvotes: 1

Related Questions