I am working on a social network. I need to add the βfind friendsβ function based on the user's phone number and their address book (for example, whatsapp and others).
The application that I am developing will be available all over the world, and I was wondering how others deal with the problem of preliminary and country codes. Of course, I could find a way, but I am sure that this is a fairly common problem with this function. The problem is that some people store numbers with a country code, and some do not. Do I need two versions of a phone number in my database?
What I think about it:
1) user registers with numbers and types of country code, and the rest of the number separately (two text fields). Then there are two separate columns in the database. One with the whole number, including the country code, and the other with the number, except the country code.
2) Then another user searches for friends through his address book. In PHP, each number is checked, and those starting with "00" are compared with the numbers in the international number column. Conversely, those that do not start with β00β are compared with a number without a country code. This way, users can find their friends no matter how they saved their number.
I would be grateful for any help, links, tips or guidance. I am looking for optimal approaches.
Thanks!
ios server-side
user3137177
source share