Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!