Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在React JS中不使用JavaScript提示符收集Firebase手机验证代码_Javascript_Reactjs_Firebase_Firebase Authentication - Fatal编程技术网

如何在React JS中不使用JavaScript提示符收集Firebase手机验证代码

如何在React JS中不使用JavaScript提示符收集Firebase手机验证代码,javascript,reactjs,firebase,firebase-authentication,Javascript,Reactjs,Firebase,Firebase Authentication,这个问题是以下答案的后续: 在回答中,短信代码是通过提示收集的。但我想知道如何使用自定义输入字段收集它 谢谢。使用提示符只是为了说明,而不是推荐的流程 result.user.linkWithPhoneNumber(phoneNumber, appVerifier) .then(function(confirmationResult) { // Show your UI where you ask user to input code. document.getE

这个问题是以下答案的后续:

在回答中,短信代码是通过提示收集的。但我想知道如何使用自定义输入字段收集它


谢谢。

使用提示符只是为了说明,而不是推荐的流程

result.user.linkWithPhoneNumber(phoneNumber, appVerifier)
    .then(function(confirmationResult) {
      // Show your UI where you ask user to input code.
      document.getElementById('codeInputForm').style.display = 'block';
      // Listen to code submit.
      document.getElementById('codeInputSubmit')
          .addEventListener('click', function() {
            // Get code and verify it is not empty.
            var code = document.getElementBydId('smsCode').value;
            if (!code) {
              return;
            }
            // Complete sign-in.
            confirmationResult.confirm(code)
              .then(function(result) {
                // Successful linking.
                gotoSuccessPage();
              })
              .catch(function(error) {
                // Handler error;
              });
          })
    })

发布您的代码,以便我们可以帮助您她是我代码的链接: