Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does WhatsApp know the country code of my contacts? [closed]

I'm in the US, where a phone number looks like this:

without country code: 123-456-7890

with country code: +1 123-456-7890

Now, according to Wikipedia, a phone number in Italy has this format:

347 xxxxxxx (from within Italy)

So that could look like a US number: 347-123-4567

When I open all my contacts on WhatsApp, it automatically adds the country code, so if I have a US phone 123-456-7890, it adds a +1. But how does it know it's a US number? It could have been anything.

I guessed that it uses my current locale or timezone to determine where I am, and any phone numbers that don't have a country code, just add the current user's country code. But I changed my locale settings in my iPhone and it was still able to guess which country the number belongs to.

Any idea how that's possible?

Update: Also, I just tried adding a new phone number while my phone was in airplane mode while my region settings were set to Italian while my timezone was set to Rome, Italy, and it still knew I put a US number, so it can't possibly be connecting to a server to get this info.

like image 961
Snowman Avatar asked Oct 24 '12 15:10

Snowman


People also ask

How WhatsApp detect country code?

WhatsApp uses your phone contacts to send and receive messages and calls. In case you are using an enterprise number with a different country code prefix than your mobile number, WhatsApp will automatically add the enterprise number country code to the contacts that are missing a country code prefix.

Is country code necessary for WhatsApp?

A phone number in full international format includes a plus sign (+) followed by the country code, city code, and local phone number. When contacting WhatsApp, always send your phone number in full international format.

What country is +1 in WhatsApp?

So when you enter a number like (347) 123-4567 this is assumed to be a US phone number because you have chosen United States under the Region Format. So WhatsApp can assume the +1 because there is no explicit country code in the number.


1 Answers

WhatsApp knows what country code you are 'in' because you have verified your own phone number with WhatsApp. Phone numbers that don't have an explicit international format, meaning they don't start with '+' or '00', are checked against your own verified country code. This is how WhatsApp knows to use country code 1 in your case.

like image 72
Michael Donohue Avatar answered Sep 22 '22 15:09

Michael Donohue