Topic-icon How to import Facebook friend list and Gmail contact list using JFB ?

Active Subscriptions:

None
We have purchased the JFBConnect Joomla Social Login extension for our website. Now i want to import the facebook friend list of logged in user. I checked the extension, but i couldn't find the way to import facebook friendlist and gmail contact list. For this i need a support from your technical team. Kindly let me know the details ASAP.
The topic has been locked.
Support Specialist
With GMail, it's not possible to import a list of friends over the API. That's a restriction placed by Google that I'm not sure of any way around.

For Facebook, it is possible, but not something we natively support. There are many Terms of Service requirements on what you're allowed to do with a user's friends, which is why we don't have a method to import it. Also, it's a matter of where and how to store it. Can you describe where you want to store the list, how you plan to access it and what you want to do with those friends once you have them in your system? That will help us understand your goals and if it's even possible to do what you're looking for as well as if it would be inline with Facebook's requirements

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
Hi Alex, Thanks for your reply.

I need logged in user's friends list. And i am going to compare that facebook id with my website registered user's facebook id ( i.e ) user who registered by using facebook. And i am going to display their photo and name (that i already have) for follow option. I am going to display only user's who registered in my website by using facebook account. Here i no need to save the friends details, if the user's friend list id match with my registered user facebook id it should display in user's follow list option.
The topic has been locked.
Support Specialist
It sounds like you're looking to do this for your own profile system. If so, I'm assuming you (or a developer) can implement some code to do what you're looking for. Below is a very quick snippet based on the Facebook API calls for getting a user's friends .
$user = JFactory::getUser(); // Get current user
$userId = $user->get('id');
$facebookId = JFBConnect::usermap()->getProviderUserId($userId, 'facebook');
$friends = JFBCFactory::provider('facebook')->api('/' . $facebookId . '/friends');
foreach ($friends['data'] as $friend)
{
  $friendJoomlaId = JFBCFactory::usermap()->getJoomlaUserId($friend['uid'], 'facebook') // See if a Joomla user exists for this Facebook id
  if ($friendJoomlaId)
  {
     // Do whatever needs to be done with this user account
  }
}
That is all untested code, but looks right. Please feel free to implement as necessary within your profile extension and let us know if you run into issues.

Finally, please note that you'll need to add the 'user_friends' field into the 'Additional Permissions Request' box in the JFBConnect -> Configuration -> Facebook area to make sure you request that permission from your users. I'd recommend reading up on that permission in Facebook's Docs as well:
developers.facebook.com/docs/facebook-lo...ference-user_friends

I hope that helps,
Alex
The topic has been locked.