lundi 21 mai 2018

How do I keep an updated list of resources over time

I am writing an application where I ask users to register their phone numbers so I can match them as 'acquaintances'. The idea being that a phone number is relatively unique and static. So my challenge is how to go about it.

For now, I decided that when they register their number, I normalise it to the international standard (+ prefix). So in the cloud I have a list of all the registered users with their phones.

When the app starts I will read all the contacts of the user and get the phone numbers. I will have some logic that also normalises them so they are in the same format as the ones on the cloud.

My solutions so far is the following: Every time the app starts, I will read the contacts and extract the normalised phone numbers. The first time I will send all of them to the cloud and compare them against the cloud numbers. The ones that are matched will be 'acquaintances' and will return their corresponding app ids. I will store those in a file of the app. Now every following time, I will read the contacts, extract the phone numbers, find the difference from the ones I saved in the file (the ones I already know they are 'acquaintances') and send the rest to the cloud in hope that some more have signed up to the app. I update the file accordingly to the response.

Can I have some comments/thoughts/ideas on it? Am I missing something? Is there an easier way? A different approach?

NOTE: Let's forget about GDPR and security, I will be hashing them and some other stuff and using the hashs instead of the actual phone numbers, but I want to focus on the matching part.

Aucun commentaire:

Enregistrer un commentaire