1

I'm trying to open a facebook post dialog when I click on some element. Dialog itself is working well. I could write some comments in the text field and the post could be seen on the website. However I want to add some info the area below the comment, which contains caption, link, picture and so on. I referred to several tutorials to implement this but they didn't work for me. Say, the caption I entered would not be shown in the dialog. The code is like:

mFacebook = new Facebook(APP_ID);
mAsyncRunner = new AsyncFacebookRunner(mFacebook);


dFbPostButton.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {

      Bundle b = new Bundle();
      b.putString("caption","Check This Hotel");

      //Result is the class name
      //Nothing too much in SampleDialogListener                 
      mFacebook.dialog(Result.this, "feed", b,new SampleDialogListener());
    }
}

Any help would be really appreciated!!

ssb
  • 209
  • 6
  • 16
  • Check this links it might help you. [Post Message to Facebook - wall link 1][1] [Post Message to Facebook wall link -2 ][2] [Post Message to Facebook wall link -3 ][3] [1]: http://stackoverflow.com/questions/5280720/facebook-post-on-friends-wall-in-android/7744153#7744153 [2]: http://stackoverflow.com/questions/7712281/facebook-post-to-wall-on-android-message-only/7712424#7712424 [3]: http://stackoverflow.com/questions/8911470/how-to-publish-image-and-url-on-facebook-using-latest-facebook-sdk-for-android/8911704#8911704 – Venky Apr 23 '12 at 04:59
  • Have you tested some other information such as "message": b.putString("message","Check This Hotel"); from memory I think a caption will only appear if you are posting an image aswell. b.putString("description", "Check This Hotel"); may work – kmb64 Apr 23 '12 at 05:01
  • Hi, Venky. Thanks for the links. My problem seems to be more like: how to show those info in the dialog instead of just posting to facebook. – ssb Apr 23 '12 at 05:17
  • hi, nz_karl. I tried both ways but nothing showed up:( – ssb Apr 23 '12 at 05:18

1 Answers1

2

Follow the below code

 Bundle params = new Bundle();
    params.putString("caption", "Mona Lisa");
    params.putString("description","The Mona Lisa...");
    params.putString("picture","http://tineye.com/images/widgets/mona.jpg");
    params.putString("name", "Mona Lisa");

        mFacebook.dialog(this, "feed", params, new DialogListener() {
            @Override
            public void onComplete(Bundle values) {}

            @Override
            public void onCancel() {}

            @Override
            public void onError(DialogError de) {}

            @Override
            public void onFacebookError(FacebookError fbe) {}
        });

it ll help

P Srinivas Goud
  • 886
  • 1
  • 12
  • 30
  • cool, your code worked for me so I realized that there is something wrong with my 2nd parameter in putString() function. Thanks for the help!! – ssb Apr 23 '12 at 05:20