shareDialog = new ShareDialog(this);
if (ShareDialog.canShow(ShareLinkContent.class)) {
linkContent = new ShareLinkContent.Builder()
.setContentTitle(title)
.setContentDescription(description)
.build();
shareDialog.show(linkContent);
}
I want to post only text content on Facebook wall using Facebook SDK. How can I do it. please help
and I have used this following code
private fun postToFacebook() {
mFacebook?.dialog(this,"feed" ,object :Facebook.DialogListener{
override fun onComplete(values: Bundle?) {
showToast("success")
}
override fun onFacebookError(e: FacebookError?) {
showToast("error")
}
override fun onError(e: DialogError?) {
showToast("error")
}
override fun onCancel() {
showToast("canceled")
}
})
}
This shows an error message for me but this code is working for a Youtube video. error getting is herf or media required error
this following link they are doing what i needed i think they using old sdk is in eclips
It's limitation of Android SDK due to Platform Policy. You can get more information here (Sharing on Android - Facebook), but in a few words - you cannot share predefined text via Facebook Share Widget: