1

I hope this is no duplicate - I found a lot of Q&A around the topic but nothing addressing this issue:

I am building an app on the Ionic Framework which allows me to access the phone's address book (Cordova Plugin) - and gives me access to the Facebook API (another Cordova Plugin).

The feature I am trying to build would use both to check: Which of your Facebook Friends are in your Address Book?

Pulling the data is not the problem, but what is the right approach to compare them? Firstname/Lastname? (I personally have people with Nicknames or who knows what, stored in my address book. So it wouldn't really work in many cases for me.)

Anyone who could point me to the a better approach here?

Steven M
  • 574
  • 4
  • 20
  • it is indeed a problem to pull the data, you can only get friends who authorized your app with the facebook api. so you can only compare those. that being said, you just need to loop through the address book and compare names and emails, whatever you want to compare. – andyrandy Apr 06 '16 at 17:43
  • @luschn compare by email in impossible, because de friend list from fb not return email for each friend. By names is also a bad idea because nothing can ensure that they have the same name, can be a way but would not be very reliable result. – jose920405 Apr 06 '16 at 18:34
  • there is no other way. and again (which is very important), you can only get friends who authorized your app too. – andyrandy Apr 06 '16 at 21:55

1 Answers1

0

i think ther is a way for make that facebook can return the email for each friend using /me/friends in graph api. Using read_custom_friendlists additional permission. you should follow this way.

You can guide with this link

If finally this works, you can get the email from fb friend and email from contact and compare it

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
jose920405
  • 7,982
  • 6
  • 45
  • 71
  • friendlists are not friends. this is pointless, you can't get all friends, you can only get friends who authorized your app too. and especially the email is impossible to get in any case, not even with any workaround, if the friend did not authorize the app with the email permission too. – andyrandy Apr 06 '16 at 21:54
  • @luschn thanks for the info, it is regrettable to hear what you say for email. But exist other way for get non app friends using `/me/invitable_friends` – jose920405 Apr 07 '16 at 12:46
  • no, you are only allowed to use that endpoint for inviting friends to a game with canvas implementation, as you can read in the docs. and even then: emails are off limits, thankfully. – andyrandy Apr 07 '16 at 21:40