How can I validate a phone number for my location like most messaging apps do (WhatsApp and Telegram)?. Is there some API for this and if so how to use it?
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
3
Answers
You could use Google libphonenumber it can do some validation. You can try live demo here.
You can use Neutrino API for that and many other things.
And google has it’s own too, called
libphonenumber
You can use the google libphonenumber for validation as ma3a mentioned. It is what google uses on Android phones to determine that you are writing a phone number. For a much simpler approach you could use a regex. (Here is a site that has a list of them that might be sufficient: regexlib.net)