Search code examples
androidfacebookposthyperlinkfacebook-sharer

Share link on Facebook via android app with automatic parsing


When posting a link on Facebook, the link to an article is automatically parsed, displays the link, article title, short description, and a thumbnail.

I want to do the same thing, but from my android app. I have set up the Facebook SDK already and the log in feature and request for permission is already working fine. However, I don't know how to proceed with sharing a link on Facebook, and automatically let Facebook handle the parsing.

I also want to display the Facebook post dialog, so that the user can add a personal message with the shared link. Right now, I'm using the dialog method of Facebook but it doesn't work. It doesn't even display the dialog box. Any ideas?

Bundle parameters = new Bundle();
parameters.putString("link", link);
// post on user's wall.
facebook.dialog(context, "feed", parameters, new PostDialogListener());

Solution

  • Finally, I got this to work. It turns out that the code I'm using above is working fine. The problem was that I was getting a facebook error due to incorrect hash key.