简体   繁体   中英

Adding content to Facebook feed dialog with new Facebook SDK for Android

I'm aware to this thread, with same question as my.

but as it says in one of the comments there- API was changed to this one and the "message" attribute is now ignored. is there a way to set the text box content with the new API?

here's my code:

protected void post() {
    Bundle params = new Bundle();
    params.putString("message", "my message here");
    facebook.dialog(this, "feed", params, new DialogListener() {
        @Override
        public void onFacebookError(FacebookError e) {
        }

        @Override
        public void onError(DialogError e) {
        }

        @Override
        public void onComplete(Bundle values) {
        }

        @Override
        public void onCancel() {
        }
    });
}

Thx.

I have been looking about this as well and I think I have found the solution. Sadly enough the documentation for this was for iOs and can be found here ;

 Bundle params = new Bundle(); params.putString("link", "your app url here"); params.putString("picture", "your img url here"); params.putString("name", "your post title"); params.putString("caption", "your subtitle"); params.putString("description", "your message"); facebook.dialog(Your Context, "feed", params, Your DialogListener); 

Don't try to use just one parameter, you have to use them all to make it work.

I hope this helps you out.

EDIT

The message tag is ignored as of 12 July 2011 I would advice you to use the "description" tag for what ever message you would like to share.

This is the quote from Facebook about the "message" parameter: "On July 12, we are ignoring the message parameter in Feed Dialogs. This eliminates the ability to pre-fill stream stories (prohibited by Policy IV.2). This change encourages users to share authentic and relevant content with their friends."

source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM