Attach picture to Facebook for Android Share Dialog - facebook

I am currently trying out the Facebook for Android Share Dialog(https://developers.facebook.com/docs/android/share-dialog/) that was introduced in Facebook for Android SDK 3.5.
The code for starting the dialog is straight forward:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this)
.setLink("https://developers.facebook.com/android")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
Similar to setLink() there is a setPicture(String url) method in FacebookDialog.ShareDialogBuilder. But I can't get this setPicture() method to work. I have tried to put Url to local image files, online images and also FB staged images (fbstage://...) but nothing seems to make any effect on the Share Dialog viewed or the resulting post.
Is there anyone that got the setPicture() method to work?

from documentation of facebook feed
The picture must be at least 200px by 200px.
And even more restriction on image to be, check here
This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)

With ShareDialogBuilder its not permitted to shared a local file but only remote files.
Currently I think that the only way (via a share dialog) is through the open graph action dialog.

In order for you to call the setPicture() should be used with setLink().
Please refer to the article below.
https://developers.facebook.com/docs/reference/android/current/class/FacebookDialog.ShareDialogBuilder/

You need to use an external URL like:
.setPicture("http://yourdomain.com/images/xyz.png");
Also, it will only display if you've set the link.

Related

Facebook always butchering my image on timeline

I've been working on an Android game, and I wanted to setup a webpage to redirect to the download page. This part was easy.
So I share it on my facebook timeline. Ok, my screenshot gets cropped horribly. Spend 30 minutes reading all sorts of guides on how to point facebook to the proper image for a thumbnail ...
No matter what I do, facebook always, always, always shows a horribly cropped image. I would like to simply specify the correct image to facebook using og:image but it seems to always ignore this. I've tried many different combinations of properties and it's always wrong. I've tried making the og:image square, doesn't matter. I've tried making it smaller, doesn't matter.
It's also hard to figure out if facebook is caching an old image or not, no matter how many times I go on the debug link and tell it to scrape things again.
Can anyone tell me any change I can make to show the entire image instead of the horrible cropped version?
I went to http://validator.w3.org and made sure the page didn't have errors beyond the og ones you apparently can't avoid.
The page is: www.playlunapuma.com
There must be a way to convince facebook to show a different image that looks good.
The thing that finally worked was resizing the og:image to 600x315 exactly.

How to prevent differences between facebook object debugger and share dialog data?

For some reason the object debugger displays all the data that I want to share with no issues but the share dialog fails to display the image. I have searched the site looking for answers and most of the solutions recommend clearing the browser cache. I've done this countless times but I still cannot make the share dialog display the image.
According to the open graph specs my image is valid so I do not know what the hell is going on.
How could I approach this? Should I report it as a bug to Facebook?
Is it because my image is not a square?
I have been testing this in a QA environment so it is not because of localhost.
Thanks!

Facebook debugger not finding correct og:image or refusing to use it

I run a Wordpress blog. Here's the URL to our main page: http://theoriginalsocitey.com
For some reason, when links to posts on our site are shared, the featured image is not correctly detected. When I put a link to a post through the Facebook debugger, some of the usual minor errors come up that do for all sites, including those that work perfectly. I've tried fixing the "tags in body" error with success, but it didn't fix the problem, so it is not the issue.
All other OG tags are displaying correctly, just the og:image has the issue. The debugger even acts like it knows what image to use, but refuses to do so. It will say the correct image but say "the image is not large enough" when it clearly is, for all posts.
Can someone please help me figure this out? It's been days of countless different attempts of fixing this including plugin deactivation, reactivation and new installations and nothing has worked.
Here's an example of a post URL to use for debugging: http://theoriginalsociety.com/quest-castro-jon-bellion-logic-24-freestyle/
It seems like the open graph image is too small (150x150), therefor Facebook is using the larger image it found on the page. It's in your best interest to give Facebook as large an image as possible.
[https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/][1]
og:image – This is an image associated with your media. We suggest
that you use an image of at least 1200x630 pixels.
Try providing a much larger image and see if that solves the problem.

Official Facebook Connect button as PNG

Is there any official Facebook Connect button, as a image file?
There a lot of really different images on the web, with different sizes, different styles (and even colors), different licenses, free and paid. But I believe there should be some official example, as PNG image.
I know that by using https://developers.facebook.com/docs/reference/plugins/login/ I can generate HTML and make screenshot, but seems that it's too hacky, and I'm just missing right page. Is it?
Brand Permissions Center doesn't have 'Connect' button
You can get the official "Log in with Facebook" button here. ZIP has PNGs for different sizes
https://developers.facebook.com/docs/facebook-login/checklist/#brandedlogin
EDIT 26/07/2014: Facebook seems to have removed those image assets. They now suggest you using a Javascript log in button with their button style. https://developers.facebook.com/docs/plugins/login-button
EDIT 21/02/2018: Facebook has updated the guidelines with a new "Continue on Facebook" button image asset
Would comment on existing answer, but rep... =\
You can still download the icon here. I guess they've dedicated a separate domain to it now. I believe they will always have to provide you with an icon alternative since they require, just as google does:
The "f" Logo may be used alone or alongside other social icons. It should be used at equal size to neighboring icons. Be sure to maintain its shape and proportions and provide adequate clear space between logos.
You can't really do this consistently without a proper icon.

Issue with og:image and Facebook Recommendations

We have a site here: http://blistergearreview.com/ which we recently setup the open graph meta tags on. The issue that we cannot figure out is on the homepage we have the Facebook recommendations plugin and even though the og:image displays correctly using Facebook's lint tool (https://developers.facebook.com/tools/debug) for all of the posts in the recommendations box they don't actually display in the box itself. We've tried several things and are stuck. Has anyone else had an issue similar to this?
I also recommend using a jpeg/jpg image instead of png.
You may be able to see it using facebook debugging tools but when a user shares one of your links it may still be showing an outdated image.
It seems that facebook doesnt like png files...
I see your image (http://blistergearreview.com/wp-content/uploads/2011/07/012011_BlisterLogo_white2.png) is 309px x 73px. This is larger than the acceptable 3:1 aspect ratio maximum Facebook accepts. Get the width/height aspect ratio less than 3.0 and your image should appear.
I just wish Facebook would check the size in the linter tool so it would error out on images that don't comply (as you would have seen the error there).
For additional requirements, please see: https://developers.facebook.com/docs/reference/plugins/like/