Facebook post to wall on Android, message only

前端 未结 3 1077
余生分开走
余生分开走 2020-12-20 10:48

The below code only seems to POST the \'message\' and nothing else. Is there something I am missing? (using the Facebook Android SDK)

parameters.putString(\"         


        
3条回答
  •  再見小時候
    2020-12-20 11:19

    Check my edited answer, it will post on the user's wall:

    It will show the exception case, but don't bother about it, your post will be succeed.

    public void postOnWall() {
        try{
            Bundle parameters = new Bundle();
            parameters.putString("message", "Text is lame. Listen up:");
            parameters.putString("name", "Name");
            parameters.putString("link", "http://www.google.com");
            parameters.putString("caption", "Caption");
            parameters.putString("description", "Description");
    
            String  response = facebook.request("me/feed",parameters,"POST");
            Log.v("response", response);
        }
        catch(Exception e){}
    }
    

提交回复
热议问题