Multiple Facebook Images using FB.ui? - facebook

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?

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'
}
})
});

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

Feed dialog doesn't publish large images

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.

action links text in facebook post to wall dialog using javascript not working

I trying to bulid a facebook application using javascript.In my application, the user gets the result and a dialog after a time delay popup. Everthing is working well except one here's my code for the 'post to wall dialog'
<script>
var publish = {
method: 'stream.publish',
display: 'popup', // force popup mode
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
actions: [{ name: 'action_links text!', link: 'http://www.example.com' }],
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.'
),
href: 'http://www.example.com/'
}
};
FB.ui(publish, Log.info.bind('stream.publish callback'));
</script>
The line containing actions not working for me.Can anyone just inform what is the solution for this...
The property should be called action_links not actions and only have text and href values. Use something like:
action_links: [{ text: 'action link test', href: 'http://example.com'}]
Note that the action must be defined through the fb web interface for the app!

facebook stream.publish

I'm making a facebook app and using stream.publish to share something on a wall.
However for the 1) attachemnt link, and the 2) the FB UI action link, when I click either, it will load the page in the same browser window.
I would like to somehow add into these links something like target="_blank" so it opens the link in a new tab.
I know this is possible because when I share a video on youtube it has a target="_blank" on the action link and on the share link.
Does anyone know the trick?
I've tried code like this (I inserted the target blanks) but it doesn't add a target element in the hyperlinks:
FB.ui(
{
method: 'stream.publish',
message: 'Check out this great app! http://apps.facebook.com/{your_app}',
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',
'target': '_blank',
'src': 'http://test3.com/test.png',
'href': 'http://test3.com'}],
href: 'http://test2.com',
target: '_blank'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect',
target: '_blank'
}
);
Does anyone have any idea how youtube can accomplish the targets
I believe what you are looking for is
display: 'popup', after method: 'stream.publish'
target is in reference to a fb user_id to post a wall-to-wall