如何在使用 firebase phone auth 进行验证后获得用户 phone 号码

how to I get the user phone number after verification in react using firebase phone auth

import React from "react";
import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
import firebase from "firebase";
import './firebaseui-styling.global.css';

const config = {
  // My firebase config
};

firebase.initializeApp(config);



const PhoneVerification = () => {

    const uiConfig = {
        signInFlow: 'popup',
        signInOptions: [
            {
                provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
                recaptchaParameters: {
                    type: 'image',
                    size: 'invisible',
                    badge: 'bottomleft'
                },
                defaultCountry: '+91',
                whitelistedCountries: ['IN', '+91']
            }
        ],
    }

    return (
        <div>
            <StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()} />
        </div >
    )
}

export default PhoneVerification

如何让用户输入 phone 号码,因为我想将它存储到数据库中,我使用它只是为了验证而不是为了验证用户

你会在用户对象中得到 phone 个数字

 callbacks: {            
                signInSuccessWithAuthResult: function (authResult) {
                    var user = authResult.user;
                    console.log(user.phoneNumber)
                }
            }