Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we change the image of link (Which is posted by android app) on facebook

Can we change the image of link (Which is posted by android app) on facebook

I am posting some link on FaceBook through my application, but I want other image to be shown on Facebook wall

my code goes like this

Intent shareCaptionIntent = new Intent(Intent.ACTION_SEND);
shareCaptionIntent.setType("image/png");
shareCaptionIntent.putExtra(Intent.EXTRA_STREAM, "<URL>");
//set caption
shareCaptionIntent.putExtra(Intent.EXTRA_TEXT, "example caption");
shareCaptionIntent.putExtra(Intent.EXTRA_SUBJECT, "example caption");
startActivity(Intent.createChooser(shareCaptionIntent,getString(R.string.share)));

I can see Caption and description also. How can I change the image and make description and caption visible, Please find attached image enter image description here

like image 648
Sharanabasu Angadi Avatar asked Jul 12 '13 10:07

Sharanabasu Angadi


2 Answers

If you are just doing a share, the link that you are sharing gets linted (parsed) by Facebook and grabs the meta tags defined on the destination url that you are sharing.

Specific to your question:

<meta property="og:title" content="The Rock" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
<meta property="og:description" content="A great movie with Sean Connery and Nicolas Cage" />

If you have access to change those meta tags, then you can control the image, the title and the description of the post that is displayed on Facebook.

For reference, see http://ogp.me/ as well as using the Facebook debugger http://developers.facebook.com/tools/debug to lint (parse) the url that you are sharing.

like image 162
Joey Schluchter Avatar answered Nov 09 '22 06:11

Joey Schluchter


You can do this by using Android Facebook SDK (change all the stuff that is posted), if you really need it. https://developers.facebook.com/docs/howtos/androidsdk/3.0/publish-to-feed/

or

PublishFeedHowTo sample demo (L:150-L:154) https://github.com/fbsamples/android-3.0-howtos/blob/master/PublishFeedHowTo/src/com/facebook/samples/publishfeedhowto/MainFragment.java

like image 42
Eugene Pinchuk Avatar answered Nov 09 '22 04:11

Eugene Pinchuk