I need to share image along with the text and pre-populated hash tag to facebook. So i integrate facebook SDK for sharing.For that i used the following code:-
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(image)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.setShareHashtag(new ShareHashtag.Builder()
.setHashtag("#loveloqal").build())
.build();
Now i can populate the image and hash tag But can't populate the text.i heard that the posting userdefined posts are against the privacy policy of facebook.Is there any way to do this.I searched a lot.Can someone help me to find a solution??
you can use SharelinkContent https://developers.facebook.com/docs/reference/android/current/class/ShareLinkContent/
It is added in
facebook-android-sdk:4.6.0
To use it:
Create a provider in your
manifest.xml
file like abovecreate Sharelink content with data and image
Show the dialog.
ShareDialog.show(ShowNavigationActivity.this,shareLinkContent);
After some research there is i found that
SharelinkContent
has bugs in facebook sdksee this: Description not shown in Facebook ShareDialog
you can use
Open Graph
instead... see this:1.https://developers.facebook.com/docs/sharing/opengraph/android
And
Hope it helps u...