与SDK 3.0发布在Facebook上墙

编程入门 行业动态 更新时间:2024-10-27 16:24:23
本文介绍了与SDK 3.0发布在Facebook上墙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想发表它的ID定义用户的墙上的消息,但在回应我得到一个错误未知的方法。

我的code是:

最后捆绑PARAMS =新包(); params.putByteArray(信息,测试.getBytes()); params.putByteArray(名,美国圣母.getBytes()); params.putByteArray(链接,bit.ly/12345.getBytes()); params.putByteArray(说明,一年级女大学生从一个奖学金......的GetBytes()); params.putByteArray(图片,的http://xxx/MOV1026.jpg.getBytes()); 最后请求postToWall = Request.newRestRequest(Session.getActiveSession()                                                     /+ pickedUsersId.get(0)+/饲料,参数,可以HttpMethod.POST); postToWall.setCallback(新Request.Callback() {     @覆盖     公共无效onCompleted(响应响应)     {         Log.i(Utils.LOG,response.toString());     } }); Request.executeBatchAsync(postToWall);

在LogCat中我有:

11-08 17:34:29.136:I / LOG(21699):{响应:响应code:200,graphObject:空,错误:{FacebookServiceErrorException:HTT presponse code:200,facebookError code:3,facebookErrorType:空,消息:未知的方法},isFromCache:假}

解决方案

一切看起来正确的,除非你的请求的 graphPath 参数方法。相反的:

/+ pickedUsersId.get(0)+/饲料

做的:

pickedUsersId.get(0)+/饲料

有不应该在你的曲线路径前的斜线/。您可以随时参阅文档,以了解究竟如何发布养活。 developers.facebook/docs/howtos/androidsdk/3.0/publish-to-feed/

I'm trying to post a message on user's wall defined by it's ID, but in response I'm getting an error "Unknown method".

My code is:

final Bundle params = new Bundle(); params.putByteArray("message", "Test".getBytes()); params.putByteArray("name", "American Virgin".getBytes()); params.putByteArray("link", "bit.ly/12345".getBytes()); params.putByteArray("description", "A Freshman College Girl on a scholarship from an ...".getBytes()); params.putByteArray("picture", "xxx/MOV1026.jpg".getBytes()); final Request postToWall = Request.newRestRequest(Session.getActiveSession(), "/" + pickedUsersId.get(0) + "/feed", params, HttpMethod.POST); postToWall.setCallback( new Request.Callback() { @Override public void onCompleted(Response response) { Log.i(Utils.LOG, response.toString()); } }); Request.executeBatchAsync(postToWall);

In LogCat i have:

11-08 17:34:29.136: I/LOG(21699): {Response: responseCode: 200, graphObject: null, error: {FacebookServiceErrorException: httpResponseCode: 200, facebookErrorCode: 3, facebookErrorType: null, message: Unknown method}, isFromCache:false}

解决方案

Everything looks right except the graphPath parameter in your Request method. Instead of:

"/" + pickedUsersId.get(0) + "/feed"

do:

pickedUsersId.get(0) + "/feed"

There should not be a leading slash "/" in front of your graph path. You can always refer to our documentation to see how exactly to publish to feed. developers.facebook/docs/howtos/androidsdk/3.0/publish-to-feed/

更多推荐

与SDK 3.0发布在Facebook上墙

本文发布于:2023-11-15 15:07:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1595529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SDK   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!