Phone verification in Sketchware

 Code in to send code:


com.google.firebase.auth.PhoneAuthProvider.getInstance().verifyPhoneNumber(phone, 60, java.util.concurrent.TimeUnit.SECONDS, this, mCallbacks);

}


com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks = new com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks() {

@Override

public void onVerificationCompleted(com.google.firebase.auth.PhoneAuthCredential phoneAuthCredential) {

showMessage("Verification completed");

}

@Override

public void onVerificationFailed(com.google.firebase.FirebaseException e) {

showMessage(e.toString());

}

@Override

public void onCodeSent(String s, com.google.firebase.auth.PhoneAuthProvider.ForceResendingToken forceResendingToken) {

super.onCodeSent(s, forceResendingToken);

codeSent = s;

}};{


Code to verify:


com.google.firebase.auth.PhoneAuthCredential credential = com.google.firebase.auth.PhoneAuthProvider.getCredential(codeSent, code);

signInWithPhoneAuthCredential(credential);

}

private void signInWithPhoneAuthCredential(com.google.firebase.auth.PhoneAuthCredential credential) {

fa.signInWithCredential(credential) .addOnCompleteListener(this, _fa_sign_in_listener);

}

{


Comments

  1. Kidney donor needed urgently, My client is urgently in need of a kidney transplant, If interested to sell contact here on my what'sApp number +4915219253693 Or Email: kidneydeal@gmail.com

    ReplyDelete

Post a Comment

Popular posts from this blog

Background video in Sketchware