Firebase phone authentications flow

前端 未结 1 1284
我寻月下人不归
我寻月下人不归 2020-12-07 04:44

I am little bit confused about the right flow of the phone authentication. I have noticed there is couple of scenarios that I cannot reproduce due to reason I can not comple

1条回答
  •  庸人自扰
    2020-12-07 05:32

    I cannot reproduce due to reason I can not completely delete my user from Firebase

    -> Yes you can. have a look at image.

    Answer of Question 1: -> It is not. SMS is obviously relevant. without SMS, phone-authentication will not work.

    Answer of Question 2: -> onVerificationCompleted will be called every-time.

    Answer of Question 3: -> Yes. onCodeSent is not being called every-time.

    Answer of Question 4: -> You do not need OTP in onCodeSent method. We can get verificationId and PhoneAuthProvider.ForceResendingToken in onCodeSent. we need to save verificationId in a variable. and use it while authentication user entered OTP.

    PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, YouEditTextValueString);

    My opinion: I had also these questions in my mind when I worked first time on it. I experienced that if we use same device with same phone-number, SMS is not coming and I guess Firebase or google-play-service handle it.

    Somehow right-now I am receiving SMS every time for the same device and phone-number.

    but we don't need to care about it.

    0 讨论(0)
提交回复
热议问题