How to “like” a page on Facebook from and Android Application?

房东的猫 提交于 2019-12-06 15:54:48

问题


Hi friends I have an one issue, how to likes a page in Facebook from my application?? I am able to retrieve all the information of Facebook page using page id, also i am able to comment to the page wall, my requirement is that would be able to likes a page in Facebook which i am unable to do..??.I have gone through graph API but unable to find solution..??

I tried this code

dialog = ProgressDialog.show(MyApp.this, "",
                    "please wait..", true, true);
            Bundle params = new Bundle();
    mAsyncRunner.request("PAGE_ID/likes",params,"POST",new UploadListener(), null);


public class UploadListener implements RequestListener {

        @Override
        public void onComplete(String response, Object state) {
            System.out.println("THE RES IS : "+response);
            dialog.dismiss();
        }

once i run this code it gives error THE RES IS :

{
  "error": 
  {
    "message": "(#3) Application does not have the capability to make this API call.", 
    "type": "OAuthException", 
    "code": 3
  }
}

回答1:


The Facebook documentation for Pages has been updated and is current (see https://developers.facebook.com/docs/reference/api/page/). You cannot like a Page via the Graph API, even though you can read the like count information. There are not an API for it, you can try this. like android application page in facebook from application itself



来源:https://stackoverflow.com/questions/12702355/how-to-like-a-page-on-facebook-from-and-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!