1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

WebOTP API over web Angular 13 can't retrieve SMS

Discussão em 'Angular' iniciado por Victor Rodniansky, Maio 2, 2025.

  1. I have Angular projects versions 8 and 13 , I need to implement an automatic OTP retrieval when using mobile in Chrome 99.0.4844.88.

    async otpRequest() {
    if ('OTPCredential' in window) {
    const abortController = new AbortController();
    let timer = setTimeout(() => {
    abortController.abort();
    }, 100 * 1000);

    let o = {
    otp: { transport: ['sms'] },
    signal: abortController.signal
    };

    let content;
    try{
    content = await window.navigator['credentials'].get(o);
    alert(content.code);
    }catch(err){
    alert(err);
    }
    }
    }




    I am getting this message as expected:

    [​IMG]

    But the SMS code cannot be retrieved, it seems the get function cannot access the SMS box on my phone.

    Continue reading...

Compartilhe esta Página