Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
SmsRetrieverClient.startSmsUserConsent () How to pass different sender numbers as parameter?

SmsRetrieverClient.startSmsUserConsent (senderPhoneNumber /* or null */)

This senderPhoneNumber is the number I know I will be receiving OTP from. My question is if I pass null, it can extract OTP from any number as documentation says (pass null so that it will consider any number would be allowed.). How will I know that my sender is correct? What happens if I receive two OTPs?

If this is not possible can I somehow pass two sender numbers that I am sure that either would be sending my OTP?

Anyone have any knowledge regarding this, please let know.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I did my research and writing my answer with my best. Coming to your questions

  1. What happens if I receive two OTPs?

The answer to this question is you will not receive two messages in most of the cases which contain an OTP within a span of 5 minutes.

Even though let's consider a worse situation. Suppose you receive 2 SMS containing OTP back to back in that case SMS user consent API will only show the consent for the first received SMS (Assuming you have mentioned null as sender phone number).

So basically what happens is the user consent api will stop listning for sms once it detects and show a consent.

  1. If this is not possible can I somehow pass two sender numbers that I am sure that either would be sending my OTP?

Answer : Yes you can. if you know the senders possible names i.e say AD-Something, BC-Something, CC-Something then you can register the listners for all 3 of them one by one like this

 val task1 = SmsRetriever.getClient(applicationContext).startSmsUserConsent("AD-Something")
 val task2 = SmsRetriever.getClient(applicationContext).startSmsUserConsent("CC-Something")
 val task3 = SmsRetriever.getClient(applicationContext).startSmsUserConsent("BC-Something")
     

once you declare like this your device will listen for all of those. Make sure you also check for a callback on these to know whether they are successful or not

How do I know these?

There is no official source/documentation for this. (I looked for the documentation but I didn't find any mentions regarding this) Then I tried it for myself and found it.

Honestly, I have a feeling like this question is just another version of pre-mature optimization at this time

Thank you.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda