Facebook js sdk: "select a friend" dialog, then post to their wall? [duplicate]
Asked Answered
D

2

14

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.

Dachi answered 1/3, 2011 at 21:54 Comment(1)
I was also going to ask about the select friends dialog. I'm also getting the feeling that the developer docs aren't as clear as they should be :)Prut
B
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 ..

Bigner answered 22/4, 2011 at 10:15 Comment(4)
After your user selected and invited some friends, the widget will return the facebook uids of the invited friends in request_ids parameter. You can then cycle trough these ids and post to their wall using the graph api. (you need the publish_stream permission for this)Bigner
than they will receive one invite for the "tab application". in fact i would like to share the link ( message and/or wall ) of the actual tab the user is viewing. when using method: 'apprequests' the invited user receives link to the canvas and not to the tab, am i wrong?Dachi
@Henrique You are right they will receive a request. But you can pass some data along in the "data" parameter. They will be passed to your canvas, then in your canvas if you detect that some data is present, you can redirect to your tab version... If you never use the full canvas version of the app you can redirect any connection from the canvas url to the tab url .. Does this help ? I don't think there is a way to present the "invite friend" dialog with full control and without sending the requests for real, or you'll have to do it all by yourself or find some existing implementation ...Bigner
yap.. i did a auto redirect, but its not so elegant... specially cause facebook is kinda laggy.. so a empty page flashs...Dachi
K
0

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.

Kimberli answered 1/9, 2011 at 21:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.