尝试使用facebook sdk在facebook上发布照片
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(bmp)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareDialog shareDialog = new ShareDialog(getActivity());
shareDialog.show(content, ShareDialog.Mode.AUTOMATIC);
shareDialog.registerCallback(((MainActivity) getActivity()).callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
if (isVisible()) {
pbLoading.setVisibility(View.VISIBLE);
}
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
Toast.makeText(getActivity(), "FB Error", Toast.LENGTH_LONG).show();
}
});
但得到了FacebookEcxeption
{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions}
设备上安装的最新版Facebook应用。根据用户手册,如果您使用ShareDialog,则无需获得特殊许可。
还尝试使用ShareApi.share()但结果相同。我做错了什么?