这是我现在这样做的代码:
case FB_ID:
FacebookSdk.sdkInitialize(getApplicationContext());
fbCallbackManager = CallbackManager.Factory.create();
LoginManager.getInstance().logInWithPublishPermissions(this, Arrays.asList("publish_actions"));
LoginManager.getInstance().registerCallback(fbCallbackManager,
new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
Log.d(TAG, "FB");
openFragment(MakeWallPostFragment.newInstance(social_id,null), false);
// App code
}
@Override
public void onCancel() {
// App code
finish();
}
@Override
public void onError(FacebookException exception) {
// App code
}
});
break;
这段代码给了我这样的错误:
LoginManager.getInstance().logInWithPublishPermissions(this, Arrays.asList("publish_actions")); //this is the culprit string gives me:
缺少publish_actions权限, 除非此应用程序被授权在另一个安装中发布,否则共享将失败。这个错误 我应该用它来实现它? 顺便说一下,这是带有解释的视频,但我认为所有这些内容现已弃用:http://www.youtube.com/watch?v=iBBVkwBeaY4