1
votes

I am currently using react-native-firebase/auth for phone authentication Ive linked everything and followed all the steps but i get this error when providing the confirmation code and running the confirm function provided by the module.

TypeError: Cannot read property 'native' of undefined
at confirm (ConfirmationResult.js:25)

this is the code that throws the error

    const { confirm } = await auth().signInWithPhoneNumber(`+1 ${number}`)
    confirm('123456')
1

1 Answers

1
votes

Now you're getting the result value in const. The value returned is not a function.

You can use this code

signIn = async () => {
    const { phoneNumber } = this.state;
  const confirm = await firebase.auth().signInWithPhoneNumber(phoneNumber)
  console.log(confirm);

}