简体   繁体   中英

Post pic on wall with message with Android Facebook SDK 3.0

How can i post message along with Picture using Facebook SDK 3.0 on Android,

The link -> can post small pic with link and all other information.

http://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/

What i want, is only to post Pic on wall with message, not a link with description ? I want grab screen shot of my current Android screen that i did and saved it into SD card, i need to post it with message on custom button click.

How can i do this with Facebook SDK 3.0 for android ?

You can use the Graph API to post photos to a user's wall.

See the reference page for more details.

In the Facebook SDK, you would use the Request class to make Graph API calls.

You can use the newUploadPhotoRequest method to add a photo.

If you want to add a description as well, try setting the "message" parameter:

Request photoRequest = Request.newUploadPhotoRequest(...);
Bundle params = photoRequest.getParameters();
params.putString("message", "description  goes here");
photoRequest.executeAsync();

Facebook changed this implementation for there version 2 Graph API requests, they recommend a Custom Story instead of posting (if you have your own content to put on the wall of the facebook user beside his comment, or even without his comment)

documentation goes here :

https://developers.facebook.com/docs/android/open-graph?locale=en_GB

just an error in the documentation, the facebook Open Graph objects are refered to by a colon, and not a dot, for example

they mention an open graph Object named "book" in a work space named "books" that way

"books.book"

the correct way is

"books:book"

and after you finish implementation you will need to review your application to facebook, which it's documentation goes here as well

https://developers.facebook.com/docs/apps/review?locale=en_GB

i really hate facebook documentation, it sucks

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