简体   繁体   English

如何使用Facebook4j申请权限?

[英]How to apply permissions with Facebook4j?

I downloaded the latest jar file from: http://facebook4j.github.io/en/index.html 我从以下网址下载了最新的jar文件: http//facebook4j.github.io/en/index.html

This is my code: 这是我的代码:

Facebook fb = new FacebookFactory().getInstance();
fb.setOAuthAppId("ID", "Pass");
fb.setOAuthAccessToken(new AccessToken(accesstoken)); // I get from https://developers.facebook.com/tools/explorer
fb.postStatusMessage("tester post");

I got an exception when I tried to post status: 尝试发布状态时出现异常:

SEVERE: null
message - (#200) Requires either publish_actions permission, or manage_pages and publish_pages as an admin with sufficient administrative permission
code - 200
Relevant information for error recovery can be found on the Facebook Developers Document:

Ok i solved that. 好的,我解决了。 Because I got accessToken API Graph v3.0, it don't have publish_actions permission, so I got Exception. 因为我获得了accessToken API Graph v3.0,所以它没有publish_actions权限,所以得到了Exception。

I get v2.12, It's ok 我得到v2.12,没关系

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

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