I am developing a mobile APP which has phone number authentication, once user logged in the APP, I will retrieve all the contacts on the user's phone addressbook to check who is using my APP, to do that I will loop through all the phone numbers and query firebase one by one, is there any better way to do this?.
My question similar to
how to compare my contact with the contacts uploaded in firebase database
Querying Firebase Users to Check If Contact Exists in Database
None of them have a proper solution.
1) I have "invite" button in the app, when a new user installed my app, if the new user's phone number is present in the existing user's contact list, existing user's contact list should be updated without looping through all the contacts again. (I don't want to loop through all the contacts again and again whenever user clicks the contacts tab).
2) My database has location child in the user profile collection, whenever a user updates his location in the database, that new location to be reflected in the other user's phone who has his contact saved.
Please help me to solve these problems using Firebase.