0

Another user asked a similar question the other day but it was marked as duplicate when it really was not the same question or problem as the question it was called a duplicate of.

I have phone numbers for all of my users and I want to compare a users local contacts to the apps user database. In other words, is there a way to perform a query that returns all app users whose phone numbers are contained in an array that represents a users phone contacts? The ultimate goal is to know who, in my personal phone contacts list, is already a user of the app. For example, say i have a firebase reference to my users:

[queryRef whereKey:@"phone_number" containedIn:local_phone_numbers];

Thanks for your help!

  • See http://stackoverflow.com/questions/29560088/firebase-equivalent-to-sql-where-in/29564075#29564075 – Frank van Puffelen Apr 08 '16 at 22:08
  • Thanks Frank! Is looks like your response is suggesting running a firebase query for every phone number in my local phone contacts. Would this really be more efficient than making just one query for all users by phone number and then locally comparing those results to an array of the phone contact numbers? – Michael Rose Apr 08 '16 at 22:27
  • It would not be significantly slower. See [this answer](http://stackoverflow.com/questions/35931526/speed-up-fetching-posts-for-my-social-network-app-by-using-query-instead-of-obse/35932786#35932786) of mine for an explanation. Plus the "one query for all" is not possible, so my approach has that going for it to. – Frank van Puffelen Apr 09 '16 at 00:14

0 Answers0