0

I'm trying to figure out a way to know which of my user contacts are also using my app. I have my app server running for that mission, I'll just jump into my planning of how to do this and the problem i encounter:

1) verify the user phone number with fabric's digits

2) upload user's phone number and contacts number to my server

3) save user number in server database

4) find identical phone numbers from the uploaded contact list

5) return a list of matching contacts to my app.

This, As far as i understand, should work.

The problem is country codes.

Phone numbers should be unique per public switched telephone network, but i have no idea how to handle different countries (= country code). Since phone numbers aren't saved with the country code usually, this approach will fail.

I know Fabric's digits offer a find my friends feature, but i can't use it since i'll be needing this info for later usage.

Any thoughts? Is there a better approach or a way to handle the country code issue?

Itzik984
  • 15,968
  • 28
  • 69
  • 107
  • Can't you upload the full number? If it isn't possible to get the full number (with the country code), you might want to check in which country the user is (you are probably able to do so with the internet connection, but GPS would be fine too) and add the number according to the country they are in. I don't know if the users are able to submit the phone number themselves, but if so, you might want to add the country number so they can change it if it's wrong. – Test Aug 09 '16 at 19:44

2 Answers2

0

Look in the android.telephony.TelephonyManager class. There are methods for returning the MIN/MCC, country code of the network operator, etc. You can find databases of all the country codes, MIN codes, MCC codes, etc., check against those and infer what the whole phone number is. You can also get the IMSI for the subscriber from TelephonyManager and use that as your unique id (although you'd have to figure out something else for CDMA.)

David C Adams
  • 1,953
  • 12
  • 12
  • Hi David, thanks for the answer, im wondering how can i infer what the whole user contacts country codes are? lets say i know my user is in the US, how can i infer that ALL of his contacts are also in the US? seems odd. – Itzik984 Aug 11 '16 at 09:48
0

I used this technique in getting the country code,remember to concat the + symbol before the codes. It worked flawlessly for me. Getting telephone country code with Android

I would advice against use of fabric, one of the terms from twitter is that they have the right to use the phonenumbers to learn more about the users which is a major loophole for them to spam your contacts with join twitter messages. Use plivo for sms or if your short on cash use email(Amazon SES & sendy) then roll out that functionality later after you get traction.

Community
  • 1
  • 1
Michael Mburu
  • 460
  • 1
  • 4
  • 11