简体   繁体   English

Facebook喜欢android中的按钮实现

[英]Facebook like button implementation in android

I know this question has been asked so many times. 我知道这个问题已被问过很多次了。

In my app I also want to integrate Facebook like button,after doing lots of R&D I came across the below link 在我的应用程序中,我也希望整合Facebook像按钮,经过大量的研发后,我遇到了以下链接

https://developers.facebook.com/docs/reference/opengraph/action-type/og.likes https://developers.facebook.com/docs/reference/opengraph/action-type/og.likes

and I am using the below code in my app, 我在我的应用程序中使用以下代码,

   Bundle params = new Bundle();
   params.putString("object", "http://samples.ogp.me/226075010839791");

   Request request = new Request(
   Session.getActiveSession(),
   "me/og.likes",
   params,
   HttpMethod.POST
  );
  Response response = request.executeAndWait();
 // handle the response

but when I click the like button nothing is happening. 但是当我点击“喜欢”按钮时,没有任何事情发生。

Could you all please guide me how to use the above code. 大家可以指导我如何使用上面的代码。

One more thing an extra permission is needed for implementing the above code "Permission: publish_actions".How to get this permission? 还需要一个额外的权限来实现上述代码“Permission:publish_actions”。如何获得此权限?

首次打开会话,使用权限发布权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM