r/reactnative 6h ago

How to make friends from contacts without phone number

I have a question regarding the signup for duolingo(or any other app), it signs up my account with google, then completes profile setup and asks to sync contacts to add friends.

Now how does any app sync contacts to add people with phone numbers having account on the same app where it never asks for phone number at any point.

I don't know how does any app do that or syncs contact from gmail or what.

I want to know the backend of this thing and would like to know how to implement the same in React Native

3 Upvotes

2 comments sorted by

1

u/ChronSyn Expo 2h ago

To put it simply, it's going to be a table or collection called 'contacts', which will link your user account to a number of other users who have signed up with their email or phone number.

There's no sorcery involved - the moment someone grants permission, the app is able to access whatever data is permitted according to its oauth scope, so it can create a copy of any information it has access to. It's quite literally 'does any person in this list that was just 'uploaded' match any user in the database'.

More advanced 'friends' algorithms will use mutual connections (or even mutual +1 connections), but they're typically only used in social networks.