我正在嘗試實(shí)施 firebase 電話身份驗(yàn)證,但我一直有 Uncaught TypeError: Cannot read property 'RecaptchaVerifier' of undefined。下面是我正在使用的代碼示例請(qǐng)任何人幫助解決可能的前進(jìn)方向?<!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>
Firebase recaptchaVerifier 顯示 Uncaught TypeError:
開(kāi)滿天機(jī)
2023-06-09 15:12:20