根據Firebase文檔(https://firebase.google.com/docs/auth/android/phone-auth#send-a-verification-code-to-the-users-phone),有callback
用於處理電話號碼身份驗證。如何在Firebase電話身份驗證Android中重新發送SMS驗證?
mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential credential) {
Log.d(TAG, "onVerificationCompleted:" + credential);
signInWithPhoneAuthCredential(credential);
}
@Override
public void onVerificationFailed(FirebaseException e) {
Log.w(TAG, "onVerificationFailed", e);
}
@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token) {
Log.d(TAG, "onCodeSent:" + verificationId);
// Save verification ID and resending token so we can use them later
mVerificationId = verificationId;
mResendToken = token;
}
};
我的問題是在onCodeSent
方法。它對這裏的文檔說(https://firebase.google.com/docs/reference/android/com/google/firebase/auth/PhoneAuthProvider.ForceResendingToken)
表示token
可以用來強制重發一個短信驗證碼。但是,在對文檔進行一些研究之後,我仍然不知道如何。
我想問一下如何用這個token
來重新發送短信驗證?
當然感謝。 :) –