使用fb android sdk 3.0在朋友墙上发布图像

时间:2013-02-05 17:11:05

标签: android facebook facebook-graph-api

我试图在朋友fb墙上发布图片,我正在选择朋友ID, 和以base64字符串转换的图像 只是得到以下错误的回复

{Response:  responseCode: 200, graphObject: null, error: {HttpStatus: 200, errorCode: 3, errorType: null, errorMessage: Unknown method}, isFromCache:false}

我的代码

if (hasPublishPermission()) {

        Request postToWall = new Request();

        for (GraphUser friend : selectedFriends) {
            Constants.showLog("Selected Frnd", friend.getId());
            Constants.showLog("Selected Pic", picture);

            Bundle parameters = new Bundle();
            parameters.putByteArray("message", "Greetings from Wish Well!".getBytes());
            parameters.putByteArray("link", "http://pictwist.cloudganga.com".getBytes());
            parameters.putByteArray("picture", picture.getBytes());
            parameters.putByteArray("target_id", friend.getId().getBytes());

            postToWall = Request.newRestRequest(Session.getActiveSession(), friend.getId() + "/feed", parameters, HttpMethod.POST);


            Constants.showToast(getApplicationContext(), "Posted image on friend wall");


        }

        postToWall.setCallback( new Request.Callback() 
        {

            @Override
            public void onCompleted(Response response) 
            {
                Constants.showLog("Responce Posting image", response.toString());

            }
        });
        Request.executeBatchAsync(postToWall);
    } 

请帮助

1 个答案:

答案 0 :(得分:2)

自2013年2月6日起,sdk不再支持在朋友的墙上发布图片或任何内容。您需要使用Feed对话框来实现这一目标。

检查此链接..

https://developers.facebook.com/roadmap/completed-changes/