Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can implement Feed Dialog from Facebook in Android Application?

enter image description hereImplementation of Feed Dialog for 'Publish Story' in my Android App is not working. I downloaded the sample Facebook Android-sdk from the following link :

https://github.com/facebook/facebook-android-sdk/blob/master/README.md#dialogs

In case of simple wallPost, my AppId is working.. but when I am using this for 'Publish Story' Feed dialog, I am getting this message after Log In: An error occurred with RomeFoodieGuide. Please try again later.

Even in web browser, I am getting the same Error message. Is there any work to do to AppId in my App..?

In web browser I am using the link as follows : https://www.facebook.com/dialog/feed?app_id=118611694896804&redirect_uri=http://www.example.com/response/

In my App, I using the following link : "https://m.facebook.com/dialog/feed?app_id=123050457758183&redirect_uri=http://www.example.com/response/&display=touch"

like image 953
Ayush Verma Avatar asked Sep 09 '11 11:09

Ayush Verma


2 Answers

    facebook=your facebbook object;
    Bundle parameters = new Bundle();
    parameters.putString("description", "description about link");
    parameters.putString("picture","link of picture your want add with share post.");
    parameters.putString("link", "Link you want to share");
    parameters.putString("name","Name of link");
    parameters.putString("caption","describe your caption text");


    facebook.dialog(context,"feed",parameters,new DialogListener() {

        @Override
        public void onFacebookError(FacebookError arg0) {
        //Display your message for facebook error   

        }

        @Override
        public void onError(DialogError arg0) {
        //Display your message for error    

        }

        @Override
        public void onComplete(Bundle arg0) {
        //Display your message on share scuccessful

        }

        @Override
        public void onCancel() {
        //Display your message on dialog cancel

        }
    });
like image 72
Mahesh Avatar answered Oct 14 '22 15:10

Mahesh


I'm also working on that sample fb example, we have to do some thing on that sample code on mFacebook.dialog(Main.this, "feed", new SampleDialogListener()); by using this hope it helps you.. one more thing I have tried this old fb implementation code does't worked for me (may be it's for earlier fb ver)

like image 3
LOG_TAG Avatar answered Oct 14 '22 16:10

LOG_TAG