Can't post message to friend facebook wall in android

I tried many ways to post a message to friend wall but no success:

Post on user's friends facebook wall through android application
Post message to facebook wall from android fb sdk always error
I also tested my account id and friend id aren't block from facebook, they can post message together in browser.
Here is my try:

    try { 
    Bundle params = new Bundle();

    params.putByteArray("message", "Test".getBytes());
    params.putByteArray("name", "American Virgin".getBytes());
    params.putByteArray("link", "http://bit.ly/12345".getBytes());
    params.putByteArray("description", "A Freshman College Girl on a scholarship from an ...".getBytes());
    params.putByteArray("picture", "http://xxx/MOV1026.jpg".getBytes());

    mAsyncRunner.request(((friendId == null) ? "me" : friendId) + "/feed", params,  new WallPostRequestListener());
    } catch (Exception e) {
        e.printStackTrace();
    }    

But it response error:

 {"error": {"message":"An access token is required to request this resource.",
    "type":"OAuthException","code":104}}

Then I tried to add token to the parameter but not work

     params.putString(Facebook.TOKEN, mFacebook.getAccessToken());

The problem is I can login success without error.
So, I need the right way to post a message to friend wall that worked for me.

链接地址: http://www.djcxy.com/p/49616.html

上一篇: 安卓在地图上销的位置

下一篇: 无法在Android中发布消息给朋友的facebook墙