我正在尝试实施 firebase 电话身份验证,但我一直有 Uncaught TypeError: Cannot read property 'RecaptchaVerifier' of undefined。下面是我正在使用的代码示例请任何人帮助解决可能的前进方向?<!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body class="body-film"> <h1>Enter Phone Number</h1> <form> <input type="text" id="number" placeholder="080******" /> <div id="recaptcha-container"></div> <button type="button" onclick="phoneAuth();">Send Code</button> </form><br /> <h1>Enter OTP</h1> <form> <input type="text" id="verificationCode" placeholder="OTP HERE" /> <button type="button" onclick="codeverify();">VERIFY OTP</button> </form> <!-- The core Firebase JS SDK is always required and must be listed first --> <script src="https://www.gstatic.com/firebasejs/7.24.0/firebase-app.js"></script> <!-- TODO: Add SDKs for Firebase products that you want to use https://firebase.google.com/docs/web/setup#available-libraries --> <script src="https://www.gstatic.com/firebasejs/7.24.0/firebase-analytics.js"></script> <script> // Your web app's Firebase configuration // For Firebase JS SDK v7.20.0 and later, measurementId is optional var firebaseConfig = { apiKey: "*****************", authDomain: "*****************", databaseURL: "*****************", projectId: "*****************", storageBucket: "*****************", messagingSenderId: "*****************", appId: "*****************", measurementId: "*****************" }; // Initialize Firebase firebase.initializeApp(firebaseConfig); firebase.analytics(); </body></html>
1 回答
慕容708150
TA贡献1831条经验 获得超4个赞
我看不到您在哪里添加了用于 Firebase Auth 的脚本:
<script src="https://www.gstatic.com/firebasejs/7.24.0/firebase-auth.js"></script>
添加回答
举报
0/150
提交
取消