简体   繁体   English

在Facebook上发布带有Facebook Facebook 3.0消息的图片

[英]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, 如何在Android上使用Facebook SDK 3.0发布消息和图片,

The link -> can post small pic with link and all other information. 链接 - >可以发布带有链接和所有其他信息的小图片。

http://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/ 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 ? 我想要的只是在墙上发布带有消息的Pic,而不是带描述的链接? 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. 我想抓住当前Android屏幕的屏幕截图并将其保存到SD卡中,我需要在自定义按钮点击时发布消息。

How can i do this with Facebook SDK 3.0 for android ? 我怎么能用Facebook SDK 3.0 for android做到这一点?

You can use the Graph API to post photos to a user's wall. 您可以使用Graph API将照片发布到用户的墙上。

See the reference page for more details. 有关详细信息,请参阅参考页面

In the Facebook SDK, you would use the Request class to make Graph API calls. 在Facebook SDK中,您将使用Request类进行Graph API调用。

You can use the newUploadPhotoRequest method to add a photo. 您可以使用newUploadPhotoRequest方法添加照片。

If you want to add a description as well, try setting the "message" parameter: 如果您还想添加说明,请尝试设置“message”参数:

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) Facebook改变了这个版本2的图形API请求的实现,他们推荐一个自定义故事而不是发布(如果你有自己的内容放在他的评论旁边的Facebook用户的墙上,甚至没有他的评论)

documentation goes here : 文档在这里:

https://developers.facebook.com/docs/android/open-graph?locale=en_GB 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 只是文档中的错误,例如,facebook Open Graph对象由冒号引用,而不是点

they mention an open graph Object named "book" in a work space named "books" that way 他们在一个名为“books”的工作空间中提到了一个名为“book”的开放图形对象

"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 完成实施后,您需要查看您的应用程序到Facebook,它的文档也在这里

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

i really hate facebook documentation, it sucks 我真讨厌facebook文档,很糟糕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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