Sign in with Phone Number

Use the signInWithPhoneNumber method to link a new phone number credential to an existing user account.

Ensure you have enabled the phone authentication and make appropriate configuration in your Firebase project.

Method

final userCredential = await FirebaseApp.firebaseAuth?.signInWithPhoneNumber(verificationId, smsCode);

Parameters

  • verificationId (String): The verification ID received from the phone authentication process.

  • smsCode (String): The SMS code sent to the user's phone.

Return

  • UserCredential?: Returns a UserCredential object containing the user's sign-in information.

This method verifies the phone number using the received verificationId and smsCode and links it to the existing user account.

Last updated