0

I have implemented PhoneAuth using RNFirebase and looking for an example to provide the ability to update the PhoneNumber if the user switches from one number to the other. I do see that there is a updatePhoneNumber API but still not clear on using the verifyPhoneNumber API, creating the AuthCredential and then calling the updatePhoneNumbe API. Does anyone have an example on how they all work together

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
mzafer
  • 791
  • 7
  • 21
  • See https://stackoverflow.com/questions/52647092/firebase-phoneauth-linkwithphonenumber-how-to-change-a-users-linked-phone/52649424#52649424 – Frank van Puffelen Oct 09 '18 at 03:06
  • I had read that, but what stumped me is the creation of the credential. In that example it is created in the call back of the verifyPhoneNumber(), so how is the verificationCode retrieved in the execution flow ? As I am typing this I am thinking.. may be we don't have to create the credential within the callback, instead store the verification id in state (react state ) and create the credential later and then call updatePhoneNumber... – mzafer Oct 10 '18 at 02:16
  • You'll need to verify the new phone number before you can update it, right? So you'll get the code from that flow, and then pass it into the update call. – Frank van Puffelen Oct 10 '18 at 02:54

0 Answers0