Add facebook comment box in own website with ability to tag fb users in comment

71 Views Asked by At

I am trying to implement a website which will allow users to login through facebook.The website will also have facebook embedded comment box.What I want is to provide the users to be able search and tag their friends in the comment box like they can do on any post on fb.I went through the docs on fb site but couldn't find any help.

Does fb provide any api/sdk to implement such feature?How can I implement this??

1

There are 1 best solutions below

2
On

For login through Facebook, you can use: https://github.com/mkdynamic/omniauth-facebook

To access the friends you can make an api call like this:

/* make the API call */
FB.api(
    "/{user-id}/friends",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);

it will return json formatted response:

{
    "data": [],
    "paging": {},
    "summary": {}
}

which you can use, through javascript you can popup the user. Here is a reference link for using friends in facebook through api call: https://developers.facebook.com/docs/graph-api/reference/user/friends/