Talk:Facebook.showFeedDialog
From Facebook Developer Wiki
See Also: http://wiki.developers.facebook.com/index.php/JS_API_M_FB.Connect.ShowFeedDialog
if i want to pass the continuation function but not pass in body_general and target_id, how can that be done? thanks.
- Just pass null for each of those parameters, like:
- Facebook.showFeedDialog(47130247983, template_data, null, null, continuation, user_message_prompt, user_message);
- Does this help? -- Pete (563683308 16:43, 20 March 2009 (PDT))
- actually, shouldn't it be undefined that is passed? because when nothing is provided, then undefined is set for that variable. so passing undefined will achieve the same result. But if the function actually uses arguments.length to do optional parameter, then it won't work.
There is a bug with this call - target id is not passed correctly. Please see http://bugs.developers.facebook.com/show_bug.cgi?id=3538
Can we get this fixed ASAP?
--1507361426 03:56, 11 November 2008 (PST)
Why can't we attach image URLs using this method like we can using the server-side equivalent. Wall posts aren't very friendly without some images. --536286910 14:54, 11 October 2008 (PDT)
- You mean you can't include the images key in the template_data parameter, like you can with Feed.publishUserAction? If that's the case, please file a bug. -- Pete (User:563683308)
Any chance of a pure FBJS on canvas example? I couldn't figure it out. - 193700405 02:45, 1 October 2008 (PDT)
Just setup a page with:
<script type="text/javascript"> Facebook.showFeedDialog(12345678); </script> Hello World
Use the Registered Templates tool to work out which templates you've registered: http://developers.facebook.com/tools.php?templates
If you've already set things so that your application can post items on your wall without asking then you won't get any prompt at all. However, you'll see the posts appearing on your Profile page. To switch off permission so that you will actually see the popup go to: http://www.facebook.com/editapps.php On the "Wall" settings, you'll see where to switch to asking for permissions each time. This worked for me. --536286910 14:54, 11 October 2008 (PDT)
You can include images - see my code below. I'm going crazy tho - it says it expects target ids as a comma delimited string - I've tried both strings and arrays and the target id is not recognised - a blank is left in the feed where {*target*} should be. My target is definitely a friend who has the app installed. Any ideas?
Otherwise the code below works - feed form pops up with text and images (actual urls etc changed) then once user clicks through it initiates the 'continue' function.
<script type="text/javascript">
var template_bundle_id = 35744782000;
var template_data = {
"pronoun":pronoun_arr[selected_pic],
"noun":noun_arr[selected_pic],
"images":[{
"src":"http://www.testing.com/app/square_img.php?img_id="+selected_pic,
"href":"http://apps.facebook.com/testing"
}]
};
var body_general = 'body test';
var target_ids = current_uid;
var continuation = function() {
var thisform = document.getElementById('a_form');
document.getElementById('hidden_img_id').setValue(selected_pic);
thisform.submit();
};
Facebook.showFeedDialog(template_bundle_id,template_data,body_general,target_ids,continuation);
</script>
--36814907 09:19, 23 October 2008 (PDT)
This script doesn't work :\
Contents |
[edit] Users can disallow others from posting on their wall
When a user disallows others from posting on their wall, calling 'Facebook.showFeedDialog' will simply do nothing, this is not very nice to the user. I have a link, saying 'post to this user's wall' and when the user clicks it but he won't really be able to post, it'd be nice if some screen explaining that would show up (or at least give the developer a way to realize this is happening so we can show some text!)
- This is a good point, Maria. Could you file this as a bug and someone will have a look at it soon. Thanks, Pete (563683308 13:31, 3 June 2009 (PDT))
- I have posted a comment on http://bugs.developers.facebook.com/show_bug.cgi?id=5207, because I think it is the same bug. It has been reported since May with no comments...
[edit] Potential abuse by intercepting the JSON and changing the contents
If a savvy user intercepts this call they could potentially change the images and the body text from those your application has submitted to ones the target may find offensive, posted to their wall under your application's name. Would it be possible to add an application setting that allows your application's feed stories to only contain images from a specific domain and to disallow additional body text?
[edit] Multiple Recipients
As far as I can tell, multiple recipients is simply not allowed for showFeedDialog. I consistently get this lovely bit of prose when I try to do that:
Now the question is, which wiki page is correct? This one that says to use MultiFeedStory, or the page about MultiFeedStory which says it can only send to ONE friend, in bold no less. :-(
[edit] showFeedDialog broken for posting on a friend's wall?
With no code change on my side, showFeedDialog has stopped working when including the targetid parameter. I have included the details on http://bugs.developers.facebook.com/show_bug.cgi?id=5207. Is anyone else experiencing this? --1557560908 08:57, 19 June 2009 (PDT)
