• 12-11-2022, 12:24:36
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhabalar arkadaşlar, firebase kütüphanesinden await firebase.auth().signInWithPhoneNumber(phoneNumber) şeklinde sign in yapmaya çalışıyorum olmuyor, bu şekilde istek gidince gelen hata
    Possible Unhandled Promise Rejection (id: 4):
    [Error: verifyPhoneNumber failed: Expected 2 arguments but got 1.]

    2 parametre verince await firebase.auth().signInWithPhoneNumber(phoneNumber, true)

    bu hata
    Possible Unhandled Promise Rejection (id: 3):
    [Error: verifyPhoneNumber failed: Second argument "applicationVerifier" must be an implementation of firebase.auth.ApplicationVerifier.]

    Bunun sebebi nedir? nasıl açabilirim recapth kullanmam gerek sanırım fakat onu denedim oda olmadı yada ben mi yanlış kullandım? ne yapmam gerek önerisi bilgisi olan ?
  • 12-11-2022, 12:33:16
    #2
    Merhaba, büyük ihtimalle sdk güncellenmiş, güncel halini dökümanlardan bulabilirsiniz. Dökümanlardan bulduğum örneği aşağıya bırakıyorum;
    import { getAuth, signInWithPhoneNumber } from "firebase/auth";
    
    const phoneNumber = getPhoneNumberFromUserInput();
    const appVerifier = window.recaptchaVerifier;
    
    const auth = getAuth();
    signInWithPhoneNumber(auth, phoneNumber, appVerifier)
        .then((confirmationResult) => {
          // SMS sent. Prompt user to type the code from the message, then sign the
          // user in with confirmationResult.confirm(code).
          window.confirmationResult = confirmationResult;
          // ...
        }).catch((error) => {
          // Error; SMS not sent
          // ...
        });
  • 12-11-2022, 12:52:48
    #3
    madlypixel adlı üyeden alıntı: mesajı görüntüle
    Merhaba, büyük ihtimalle sdk güncellenmiş, güncel halini dökümanlardan bulabilirsiniz. Dökümanlardan bulduğum örneği aşağıya bırakıyorum;
    import { getAuth, signInWithPhoneNumber } from "firebase/auth";
    
    const phoneNumber = getPhoneNumberFromUserInput();
    const appVerifier = window.recaptchaVerifier;
    
    const auth = getAuth();
    signInWithPhoneNumber(auth, phoneNumber, appVerifier)
        .then((confirmationResult) => {
          // SMS sent. Prompt user to type the code from the message, then sign the
          // user in with confirmationResult.confirm(code).
          window.confirmationResult = confirmationResult;
          // ...
        }).catch((error) => {
          // Error; SMS not sent
          // ...
        });
    şurayı görmüyor bu seferde import { getAuth, signInWithPhoneNumber } from 'firebase/auth'

    3 parametre istiyor ya 2 si geliyo hatası alıyorum, direk firebase kütüphanesinden çekiyorum auth u , getAuth u , firebase.auth() yapsak olmaz mı?

    const appVerifier = window.recaptchaVerifier; bu değerde undefined geliyor..

    Possible Unhandled Promise Rejection (id: 8):
    [Error: signInWithPhoneNumber failed: Expected 2 arguments but got 3.]

    tüm parametreleri verdikten sonra ki hata

    RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.

    react gibi Allah cezasını versin, iş midemi bulandırdı şaka gibi bir sorun