简体   繁体   English

Facebook Like Button Android原生

[英]Facebook Like Button Android native

Hi i have been trying to find how to add the like button to my android code. 嗨,我一直试图找到如何添加喜欢的按钮到我的android代码。 i have done the following things can anyone help me out it always throw me this error 我已完成以下操作,任何人都可以帮我解决,总是把我抛出这个错误

 {Response:  responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) Requires extended permission: publish_actions}, isFromCache:false}

i have added the publish permission in my request as wel. 我已在我的请求中添加了“发布”权限。 my code below: 我的代码如下:

public void doLike(Session session, String Id) {
    Bundle params = new Bundle();
    params.putString("object", "http://graph.facebook.com/" + Id);
    // /* make the API call */
     new Request(session, "/me/og.likes", params, HttpMethod.POST,
     new Request.Callback() {
     public void onCompleted(Response response) {
    // /* handle the result */
     System.out.println(response);
     }
     }).executeAsync();

} }

{Request:  session: {Session state:OPENED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[publish_actions, publish_stream]}, appId:xxxxxx}, graphPath: /me/og.likes, graphObject: null, restMethod: null, httpMethod: POST, parameters: Bundle[{access_token=CAAT0aKyquLEBAOxF4XYENsZBFLdD7ZALvGOvQ25ZAvGl6vmCPz8AHOQcZAnKHaOOYPv4DkL0VlMu7jveZCjmht20MuB7qLWpUZAo2DPQxG16ZAF5ICouzAbwpKmMmJdEF1HN1MzCLp5GhlYyy4f63WL5wUE21wRKiYg8wJVy3AGlATcDjpU4FyZB64dZCDv66zv228ZCsuemiFIqf5Qqwcb1QIca91WfCCDZCh71ZCz9CXegCvt1CBurddDo, format=json, object=http://graph.facebook.com/xxxx, sdk=android}]}  

this is my request but still getting the error 这是我的要求,但仍然出现错误

Just follow the screenshot and check did you set the above permissions? 只需按照屏幕截图检查您是否设置了上述权限?

在此处输入图片说明

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

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