0

I am trying to make an app which requires WhatsApp like validation of number, as heard from many people I sent a SMS from the same number to same number and check if the number is same and in message I sent a hashid generated from number and IMEI number and send the same to Server.

Now when the use receives the SMS and put the hashid on an input field and it got stored to Shared Preference and sent to server to match.

Is this the right way and same way WhatsApp doing?

halfer
  • 19,824
  • 17
  • 99
  • 186
Saty
  • 2,563
  • 3
  • 37
  • 88

2 Answers2

2

See these links

SMS registration like in the mobile app: whatsapp

How to verify the phone number similar to Whatsapp?

As it says

Send the phone number to be verified, receive a unique hash. The verification system sends a unique code to the user. Once the user passes that code to your application, the original hash and the code are sent to the verification system to be validated.

Community
  • 1
  • 1
Lal
  • 14,726
  • 4
  • 45
  • 70
  • @LalYeah I read them before...My main concern is how the SMS broadcast receiver is knowing the sms from the SMS service provider cause I can send the sms and receive to know if the number is valid or not however in case of SMS service, I dont know the way.. – Saty Apr 08 '14 at 11:56
  • You can use a broadcast receiver to listen for incoming messages – Lal Apr 08 '14 at 11:59
1

Flow for MSG verification is:

  1. User sent a request for a verification over a particular mobile number.
  2. Server sends an SMS to that mobile number with verification code, along with device IMEI number sent by the phone while asking for verification [Must be encrypted].
  3. SMS broadcast receiver receives an incoming SMS checks if it's type and if it's an verification SMS, Decrypt the contents, validates the IMEI number, gets the verification number and sends this verification number back to the server.
jitain sharma
  • 584
  • 5
  • 19
  • could you please elaborate the 3rd point, "check its type" and decryption process? – Saty Apr 08 '14 at 12:00
  • SMS broadcast receiver will be invoked for every incoming SMS, So two ways to verify if SMS is send from your server: 1) If you know the number from which server sends the SMS. 2) Some code in the starting of a SMS text which defines the SMS is from your server if server uses many GSM routers to send SMS. About the decryption process applied if you uses the encryption process to protect your data. – jitain sharma Apr 08 '14 at 12:05