如何与QUOT;喜欢"在Facebook上,并从Android应用程序的网页?并从、应用程序、网页、喜欢

2023-09-07 04:51:37 作者:校长要跳楼,我来喊加油

朋友您好我有一个问题,如何喜欢在Facebook的页面,从我的应用程序?我能够检索使用页面ID Facebook页面的所有信息,也是我能够在页面墙上发表评论,我的要求是,将能够喜欢在Facebook的一个网页,其中我不能做??。我已经通过图形API,但无法找到解决办法了??

我想这code

 对话框= ProgressDialog.show(MyApp.this,,                    请稍等......,真,真);            捆绑PARAMS =新包();    mAsyncRunner.request(PAGE_ID /喜欢,则params,POST,新UploadListener(),NULL);公共类UploadListener实现RequestListener {        @覆盖        公共无效的onComplete(字符串响应,对象的状态){            的System.out.println(THE RES是:+响应);            dialog.dismiss();        } 

当我运行此code它给错误RES为:

  {  错误:  {    消息:(#3)中的应用不必使此API调用的能力。,    类型:OAuthException,    code:3  }} 

解决方案 数据 Facebook上1亿条视频数据告诉你用户喜欢什么

有关网页在Facebook的文档已更新,电流(见的 https://developers.facebook.com/docs/reference/api/page/ )。你可以不喜欢通过图形API页面,即使你可以读出像计数信息。有没有为它的API,你可以试试这个。like从应用程序本身的Facebook Android应用程序页面

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
  }
}

解决方案

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