How to post on Facebook page's wall in Android?

后端 未结 2 1572
借酒劲吻你
借酒劲吻你 2021-01-15 03:24

Hi I want to post any message or link to an Facebook page.What I have tried is this.

void postInfo()
    {
        try
        {
            Bundle parameter         


        
相关标签:
2条回答
  • 2021-01-15 04:04

    Try this :

    void postInfo()
      {
        try
        {
            Bundle parameters = new Bundle();
            parameters.putString("message", messageFacebook);
            parameters.putString("name", "Test Name");
            parameters.putString("link", "http://www.mylink.com/");
            parameters.putString("picture", imageUrl);
            parameters.putString("display", "page");
    
            facebook.dialog(this, "stream.publish", params,
                    new DialogListener() {
    
                        public void onFacebookError(FacebookError e) {
                            e.printStackTrace();
                        }
    
                        public void onError(DialogError e) {
                            // TODO Auto-generated method stub
                            e.printStackTrace();
    
                        }
    
                        public void onComplete(Bundle values) {
    
                        }
    
                        public void onCancel() {
    
                        }
                    });
        } catch (MalformedURLException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
    0 讨论(0)
  • 2021-01-15 04:07

    Facebook has changed all it's profiles to timelines now. Any facebook page will show posts by others as "Recent Posts by Others on MyApp Page". This behavior is controlled by facebook and not by your app. There is nothing you can do in this case.

    0 讨论(0)
提交回复
热议问题