1
votes

I am working on an application that will sign up users based on their phone numbers. Everywhere I have read, there are articles regarding signing in users using their phone number. While researching for this I landed on a stackoverflow article itself that mentioned that the signInWithPhoneNumber() article will work for sign up when queried for first time, and will be used for sign in once the user is created as in this article What will happen if I sign in user using phone number without user creation in firebase?. Going by this article, I wrote the following code to achieve my purpose

import auth from "@react-native-firebase/auth";
console.log("going to sign up with", numberToSend);
// numberToSned is the input number to which the message has to be sent
const confirmation = await auth().signInWithPhoneNumber(numberToSend);

I also set up a dummy number to test the feature. But whenever this request is made my application shuts down by itself

Also I do not get any error on the console regarding this enter image description here

So I wanted to ask is their a way to sign up users using their phone number in firebase with react-native?

1

1 Answers

0
votes

As the link you describe (but didn't share) says: Firebase makes no distinction between signing up with a phone number or signing in with a phone number. The code for both cases is exactly the same, as shown in the documentation on Firebase phone authentication.