Can I “add friend” with Facebook's API?

前端 未结 4 802
感动是毒
感动是毒 2020-12-07 17:34

Does their API allow my Facebook-connected user to add a friend?

4条回答
  •  我在风中等你
    2020-12-07 17:42

    I spent a great deal of time looking, and finally came accross a very simple solution.

    Using the Facebook Javascript API you can do a friend request with:

    
    

    The callback script can then simply performs an ajax call to your server where you save info about the action, if needed.

    You can test this by using the javascript console app on Facebook:

    http://developers.facebook.com/tools/console

    Paste in the script above, including the tags, or click the "Examples" button on the bottom of the text area and find the "fb.ui — friends.add" example.

提交回复
热议问题