我们正在使用
Permission[] permissions = new Permission[] {
Permission.PUBLIC_PROFILE,
Permission.EMAIL,
Permission.USER_FRIENDS,
Permission.PUBLISH_ACTION
};
SimpleFacebookConfiguration configuration = new SimpleFacebookConfiguration.Builder()
.setAppId(getResources().getString(R.string.app_id))
.setNamespace("ournamespace")
.setPermissions(permissions)
.build();
SimpleFacebook.setConfiguration(configuration);
在登录活动中:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mSimpleFacebook.onActivityResult(this, requestCode, resultCode, data);
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onResume() {
super.onResume();
mSimpleFacebook = SimpleFacebook.getInstance(this);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ctx = this;
ImageView fbBtn = (ImageView) findViewById(R.id.authButton);
fbBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mSimpleFacebook.login(onLoginListener);
}
});
}
但是,生成的访问令牌不包括 publish_actions 权限......这里有什么问题?
谢谢!