Share on User's Wall using Facebook SDK

Apps are really getting into the "sharing" thingy. I am unsure why many developers hate to use the ACTION_SEND. Instead, they like to go into the hassle of integrating facebook into their app using the always-changing sdk facebook's offering.

I know many of you want to set the "picture" / "name" and other parameters of the facebook share, and, therefore, the normal ACTION_SEND is not adequate. If it were to me, I would force you all to use the ACTION_SEND.
Since it is not:

Here is what I consider the right way of using the Facebook SDK for the purpose of sharing. Here, I present the user with a sharing dialog so that he can add his own message to the share. I think that's the whole point of social media: user engagement. If you want auto-share, that is pretty simple and I do not feel like posting about it.

Ok. There are dozens of tutorials out there that will help you in implementing Facebook login. You will end up with a Session object that will return true if you call the isOpened function upon it.

In the following code, I used mContext and mySession: mContext is the context which is usually the activity where you want to share - mySession is the Facebook Session object which you would probably get by calling Session.getActiveSession(); or it could be handed to you in the StatusCallback when you login

Here is how to use it to share: 

Bundle bundle = new Bundle();
bundle.putString("caption", "Harlem Shake Launcher for Android");
bundle.putString("description", "Your android can do the Harlem Shake. Download it from google play");
bundle.putString("link", "");
bundle.putString("name", "Harlem Shake Launcher");
bundle.putString("picture", "");
new WebDialog.FeedDialogBuilder(mContext, mySession, bundle).build().show();


  1. Need the full process. It's urgent. Pls help.
    Error: WebDialog can not be resolved to a type.
    Thanks in advance.

    1. This is some old code but I remember that WebDialog is part of the Facebook SDK.

  2. Aucun de ses piratage Facebook fonctionne aujourd hui plus rien de marche sauf ce site qui est encore en ligne ▄︻̷̿┻̿═━δΈ€

    pirater un mot de passe facebook

  3. The fast and furious 8 is going to be one hell of a movie and I can't wait for it to come out in April. With Charlize Theron and Helen Mirren joining the cast, The fast and furious franchise has been pushed to a whole new level. Really looking forward to it.
    Movies that earn more than $1 billion worldwide tend to produce sequels. As such, Fast and Furious 8 was a no-brainer. Yet, the ridiculously lucrative Furious 7 ended with real closure Fast and Furious 8 Movie

  4. Thank you for sharing this very nice post awesome keep sharing.
    touch here