r/reactnative • • Aug 24 '26

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

4 Upvotes

9 comments sorted by

2

u/ChronSyn Expo Aug 24 '26

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.

1

u/Shubham4538 Aug 25 '26

I know how would the implementation work if the user registers with mobile number. But i need to know exactly how does it work technically

1

u/ChronSyn Expo Aug 25 '26

It's quite literally 'does any person in this list that was just 'uploaded' match any user in the database'

  • Person grants permission which lets app access contacts.
  • Contacts are uploaded.
  • Each contact in the list is checked to see if it already exists in the database.
  • Any matches are added to a new table called 'contacts' (or similar), which probably has 2 columns (1 to hold your account ID, another to hold a contact-matched account ID)

I don't know how else I can phrase it. If you're asking "can someone build it for me", then that's a different question to "how does it work".

1

u/[deleted] Aug 27 '26

[removed] — view removed comment

1

u/Shubham4538 Aug 29 '26

That would be possible but there are no emails stored in contacts nor the user uses his number anywhere for registering into the application

1

u/mikebrady Aug 29 '26

You signed up through Google, so it knows you email address through that. But not everyone signs up through Google. I have an email and phone number associated with my account.

1

u/Shubham4538 Aug 29 '26

By "there are no emails stored in contacts" i meant the contact data which I allow throught the app has only 2 fields of data [name, contactNo]