Changes

Jump to: navigation, search

Phone Number Authentication using the Firebase SDK

24 bytes added, 18:09, 14 August 2017
Phone Number Authentication
All of the work involved in generating the code and sending the SMS message is handled by a call to the verifyPhoneNumber() method of the PhoneAuthProvider instance. This will trigger a call to one of the following callback methods:
'''onVerificationCompleted() ''' – Called only on certain device configurations (typically devices containing a SIM card) where the verification code can be verified automatically on the device without the user having to manually enter it.
'''onVerificationFailed() ''' – Indicates that an error occurred when sending the activation code. This is usually the result of the user entering an invalid or incorrectly formatted phone number.
'''onCodeSent() ''' – Called after the code has been sent. This method is passed a verification ID and a resend token that should be referenced when making a code resend request.
'''onCodeAutoRetrievalTimeOut() ''' – When the verifyPhoneNumber() method is called it is passed a timeout value. This method is called if the verification process is not completed within the given timescale.
Once the verification code has been entered by the user, the code and the verification ID provided to the onCodeSent() callback are passed through to the getCredential() method of the PhoneAuthProvider class. This returns a PhoneAuthCredential object which can be used to sign the user into the app in the usual way via a call to the signInWithCredential() method of the FirebaseAuth class.

Navigation menu