如何与QUOT;喜欢"在Facebook上,并从Android应用程序的网页? [英] How to "like" a page on Facebook from and Android Application?

查看:148
本文介绍了如何与QUOT;喜欢"在Facebook上,并从Android应用程序的网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友您好我有一个问题,如何喜欢在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的文档已更新,电流(见的 https://developers.facebook.com/docs/reference/api/page/ )。你可以不喜欢通过图形API页面,即使你可以读出像计数信息。
有没有为它的API,你可以试试这个。
<一href=\"http://stackoverflow.com/questions/7766616/like-android-application-page-in-facebook-from-application-itself\">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

这篇关于如何与QUOT;喜欢&QUOT;在Facebook上,并从Android应用程序的网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆