我想发表它的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上墙
发布评论