Facebook js sdk: “select a friend” dialog, then post to their wall? [duplicate]

五迷三道 提交于 2019-12-03 08:13:03

问题


Needs to resolve that procedure.

Now using the new javascript sdk, inside my "iframe tab".


  1. Select friend(s)

  2. Post in their wall.


1: not solved

I couldn't find a way of poping a "select a friend" dialog, trough the new api. The only mention in FB.ui is about a "friends dialog" used to "invite a friend".

Maybe I need a dialog ( which one ) to select a friend and than post? Ideally multi-friend selector so I can post to as many friends as a user can choose?

2: solved

( any other solution is welcome )

To post in a friends wall, I can simply fill the "to" param of the "feed dialog" as explained here: http://developers.facebook.com/docs/reference/dialogs/feed/


Some not so elegant solutions I found:

ask access to manage user friends then:

  1. Do the multi selection pop up by myself

    looks like redoing the wheel, some FBML pages solved that problem with a simple feed dialog with friend selector, as you can see here: http://www.facebook.com/chanel

  2. Use a jquery plugin that parses the friends list and do the dialog for me

    looks like a overkill / not working very well


I feel like I'm missing something ( this is my second work with the new js sdk ), such a easy task should be pretty straight forward to solve.


回答1:


To "invite friend" you have to look there : http://developers.facebook.com/docs/reference/dialogs/requests/

A simple example :

FB.ui({method: 'apprequests', message: 'Check out my super site', title:"Invite your friends."});

Feel free to ask any question if it's not clear ..




回答2:


You used to be able to use fb:friend-selector that would automatically autocomplete the users friends. It stopped working, so I ended up recreating it using jquery ui.



来源:https://stackoverflow.com/questions/5160851/facebook-js-sdk-select-a-friend-dialog-then-post-to-their-wall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!