I have this Facebook app where a user has to share an image. With that image they have to share I filled in a description that will show up next to the image on the users wall.
But I just found that the description is missing on pages that have the new timeline enabled. The full description does however show up in the preview screen of what they will post to their wall.
This is the fb.ui code. It does post the image itself, but the description is missing on walls that have the new timeline enabled, it works fine on none timeline enabled walls.
Any ideas on how to fix it, and make the description show up there as well? Or is it normal behavior for timeline walls to not show the description?
FB.ui(
{
method: 'feed',
name: 'Test',
link: 'https://www.facebook.com/test',
picture: 'test',
caption: 'test',
description: 'test'
},
function(response) {
if (response && response.post_id) {
alert('Okay');
} else {
alert('Fail');
}
}
);
Related
When I post images using FB.ui feed it works fine but the images are links son when you click on them you cannot see a bigger version of the image.
I read that you can use:
FB.api('/me/photos?access_token=’…
But I need the dialog so the user can see the photo and add a message in FB “environment or context”.
This should be simple, no?
This is my current code:
var obj = {
method: 'feed',
link: url_base,
picture: up_img_final_url,
name: FBname,
caption: FBcap,
description: FBdesc,
};
FB.ui(obj, function(response){
if(response)console.log('Post');
else console.log('Cancel');
});
Please suggest how to post some text which is entered by an end user after clicking on a button. I searched in social plugins of Facebook. I found share plugin but it is sharing only links but not the text. How can I post the text to Facebook? In my application, I'm using normal "textarea" to enter the text/status and I'm using a submit button to post it. I want to post the entered text to my timeline in Facebook. Is there any plugin available for this? Please suggest.
Thanks,
Dinakar.
Using Javascript SDK
<script>
function share()
{
var obj = {
method: "feed",
link: "Facebook page hyperlink",
picture: "Picture hyperlink",
name: "Title",
caption: "A short caption right below the title",
description: "Description"
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
For More info: http://developers.facebook.com/docs/reference/dialogs/
So I've been trying to implement a Fb method feed so that people can share songs from my website. But it doesn't work.
It pops up a loading gif in the dialogue and thats it. No error nothing. I've wasted a lot of time trying to figure this out but haven't been able to.
Here's the code,
share_obj = { method: 'feed',
link: "", redirect_uri: "",
picture: ",
name: "",
caption:"" ,
description: ""
}; FB.ui({method: "permissions.request", "perms": 'publish_stream'},
callBack);
function callBack(response) { if(response["perms"]=="publish_stream") { var obj = share_obj; FB.ui(obj,callback_share); } } function callback_share(response) { }
Does it have something to do with Facebook app migrations or app permissions?
So turns out, there s no need to ask for user permissions when invoking the Fb.ui method.
Permissions are only required when you intend to publish stories via the graph API.
I am using this function to post on my own wall, and I would like to set the privacy of the post to FRIENDS. But it doesn't work. Always keeps the default app privacy (PUBLIC). How can I change this?
Thanks
function postToWall(message, header) {
FB.ui(
{
method: 'feed',
caption: header,
link: 'http://www.iflikeu.com',
picture: 'http://myapp.herokuapp.com/common/images/icon.png',
description: message,
privacy: {'value': 'ALL_FRIENDS'}
},
function(response) {
/*if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}*/
}
);
}
Your example is a call to FB.ui() which triggers the feed dialog - the user selects the privacy for such posts on a post by post basis
If you're posting directly via the API you'd be calling FB.api() where you can set the privacy per-post directly; using the Dialog the user can always choose post visibility, and the value in the selector defaults to their default privacy setting for your app
You can try to edit the Application settings : Configuring Permissions.
And set Default Activity Privacy: to public.
If you go to this app's wall: http://www.facebook.com/mindjolt they somehow attach several photos to each wall post. Is there a way to do this programatically?
Looks like they are posting to the wall manually, but I can't even figure out how to do this through facebook interface.
Any ideas?
You have two options that I'm aware of:
You can use the Facebook Graph API to post to someone's wall. You can attach a picture (I'm pretty sure it's only one), link, video, etc. to the post: http://developers.facebook.com/docs/reference/api/post
Alternatively, you can use the stream.publish method from the old REST API http://developers.facebook.com/docs/reference/rest/stream.publish and set the attachment.media parameter http://developers.facebook.com/docs/guides/attachments to post more than one image in one wall post.
I there no way to do it with the new Javascript API (SDK)?
The old way was:
var media = [];
media[0] = {'type':'image','src':'xxx','href':'yyy'};
media[1] = {'type':'image','src':'xxx','href':'yyy'};
media[2] = {'type':'image','src':'xxx','href':'yyy'};
media[3] = {'type':'image','src':'xxx','href':'yyy'};
media[4] = {'type':'image','src':'xxx','href':'yyy'};
attachment = {
'href':'xxx',
'name':'xxx',
'caption': '',
'media': media
};
FB.Connect.streamPublish('', attachment, '');
but the new way?
FB.ui(
{
method: 'feed',
name: attachment.name,
link: attachment.href,
caption: attachment.caption,
picture: 'xxx',
}
,
function(response)
{
alert('callback');
}
);
there is no key for attachment or for media, only picture??
edit: Ok, I got it, there is the old way, the new way, and there is the old way via the new way:
FB.ui(
{
method: 'stream.publish',
attachment: attachment,
action_links: action_link
}
,
function(response)
{
//alert('callback');
}
);