Feed dialog doesn't publish large images - facebook

I'm trying to post to User's Wall large images through FB.ui 'feed' but the post only show a small image in the left side as usual. When I use the sharer.php, the image looks large. What I need to define to post large images using the Share dialog.
FB.ui({
app_id: '<%= ENV['FACEBOOK_APP_ID'] %>',
method: 'feed',
link: '<%= request.original_url %>',
name: 'A name example',
redirect_uri: '<%= ENV['HOST'] %>',
caption: 'An example caption',
description: 'An example description',
picture: '<%= ENV['HOST'] %><%= asset_path "Facebook/#{params[:page]}.jpg" %>'
}, function(response){});
I have defined an og:image, og:type, etc but now way. Share dialog only post small images.
The image are 1200x603. The only warning the debugger is returning me is about og:url.

This is what I exactly use:
FB.ui({
method: 'feed',
link: '<url that I would like to share>',
name: "Js name",
picture: 'http://<domain>.com/media/images/questionnaire/1/1.jpg',
caption: 'Js caption',
description: 'Js description'
}, function(response){
console.log(response);
});
and this is what I see:
There is no og tags in my link address's html. Be careful about using link attribute instead of href attribute. I spent lots of hours just for finding that I should use link attribute instead of href attribute.

Related

FB feed method does not work as it used to when sharing image and url

I am trying to share image from FB app, using send dialog like I am doing for past few years.
var obj = {
method: 'feed',
link: 'https://www.facebook.com/pages/TESTPAGE?sk=app_XXXXXXXXXXXXXX&app_data=share|10',
caption: '',
name: 'Title for share',
description: 'description fort share',
picture: IMG_URL
};
I have provide 2 screenshots
when I click on share button inside of app
what I keep getting on my profile wall.
Until few months ago, FB would show data from feed method, but now, feed is acting just like share method: it shares url, without image and labels I sent through feed dialog.
All I want is to share image from app, and url of that image should point to app url.
Any suggestions?
I came across this issue from yesterday. The issue only happens when you pass in the FB app link url to the Link option. The works fine with the images as long as the link url is not anything related to FB.
So the workaround I found was to get a shortened URL from google and passed it instead of the normal app link.
FB.ui({
name: 'temp',
method: 'feed',
picture: '',
link: '{shortened url}',
caption: 'temp',
description: 'temp',
redirect_uri: 'any url'
}, function(response){
});
You can try this code to share image from FB app:
FB.ui(
{
method: 'feed',
display: 'popup', // must be one of "popup", "dialog", "iframe", "touch", "async", "hidden", or "none"
name: 'Title for share',
description: 'Description for share',
caption: 'www.facebook.com/YourFbPage/app_xxxxxxxxxxxxxxxxxxx',
link: 'http://PathToYourDomain.com/Folder/',
picture: 'http://PathToYourDomain.com/Folder/img/img-1200x627.jpg',
},function(response) {
if (response && response.post_id) {
// alert('Post was published.');
} else {
// alert('Post was not published.');
}
}
);
Best and good luck!
FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object : {
'og:url': str_href,
'og:title': 'title', //galleryItem.title,
'og:description': 'desc', //galleryItem.description,
'og:og:image:width': '2560',
'og:image:height': '960',
'og:image': str_picture //BASE_URL + '/images/works/galleries'
}
})
});

Multiple Facebook Images using FB.ui?

How do I use FB.ui to make a feed dialog post box that gives user multiple images to choose from? I am using the following code to create the pop up:
FB.ui({
display: 'popup',
method: 'feed',
name: 'title here',
link: 'url.com',
picture: 'picturepath.jpg',
caption: 'caption text', // caption
description: 'long text'
}, callback);
Is there an option to add multiple pictures here?

Facebook post via url

I am trying to send this to facebook and it works except for the title "Some Page Title" is not showing up in the post. Example
The format i am using:
https://www.facebook.com/sharer/sharer.php?u=<url>&t=<page title>
Is passing title not supported any more?
TIA
To overwrite Open Graph meta tags you're only chance is with feed method which requires an app id
JS
$('#facebook-share').click(function (e) {
e.preventDefault();
FB.ui({
method: 'feed', // feed method!
name: 'My title', // overwrites "og:title"
link: 'https://www.facebook.com/Retrogram', // required param
picture: 'http://i.imgur.com/SKwsQM2.png?1', // overwrites "og:image"
caption: 'My caption', // overwrite caption
description: 'My description' // overwrites "og:description"
});
});
Fiddle

Facebook Feed Dialog link format

I have the following code on my website:
<a onclick='postToFeed(); return false;'><img style="width: 27px; height: 27px; border: 0px;" src="{$baseurl}/images/fb_m.png"/></a>
<p id='msg'></p>
{literal}
<script>
FB.init({appId: "xxx", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
display: 'iframe',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
{/literal}
The links on my website are in the following format:
{$baseurl}/post/{$posts[i].PID}
I was trying to add this string in the "link:" section however it does not share the correct link.
Any ideas will be appreciated. Thanks
Ok, I managed to insert the link correctly. Here is how the link parameter should look:
link: '{/literal}{$baseurl}/post/{$posts[i].PID}{literal}',
Now the popup script posts a correct link such as http://mysite.com/post/1234. However another problem occurred. My website's page is a grid layout, something like pinterest style. Each post has its own link. The script however shares the last post in the grid, no matter on which post I click the share button. If I use the share button as a link, such as:
<a href="http://www.facebook.com/share.php?u={$baseurl}/post/{$posts[i].PID}" onclick=”return fbs_click()” target=”_blank”>share</a>
the correct post is shared.
I need to use the popup feed dialog instead, with the correct link. Any help will be appreciated.

How can I paste img tag into stream.publish method?

I am new in Facebook API, I found only that page about fb.ui http://developers.facebook.com/docs/reference/javascript/FB.ui . I use new connect-js, and when i just place in my text <img src="/sa/asd/asd.jpg" /> slash is escaping to \/.
Please help!
You need to set media property of attachment object, something like:
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
media: [{
type: 'image',
src: 'http://example.com/img.jpg',
href: 'http://example.com'
}],
href: 'http://github.com/facebook/connect-js'
},
You can read more about attachments here.