在我的应用程序中有一个基本的照片编辑器,我希望用户分享这些照片以分享到Facebook,AFAIK,Facebook共享并不需要publish_actions批准。我像这样使用share api:
Bitmap bitmap = imageContainer.getDrawingCache();
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(bitmap)
.setCaption("Check my new photo")
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareApi.share(content, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Log.i("success", result.toString());
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
Log.i("error", error.getMessage());
}
我已经配置了Facebook内容提供商以及Facebook开发者网站中提到的所有其他内容。但我不断收到此错误消息通过Api共享内容的权限不足。有谁知道问题是什么以及如何解决?
答案 0 :(得分:1)
您现在正在使用自定义界面的代码(ShareApi.share
):
如果您想使用自己的界面进行共享,则需要:...当人们登录您的应用时请求publish_actions权限
来源:https://developers.facebook.com/docs/sharing/android
看看文档,这可能是你需要的东西:
ShareDialog.show(activityOrFragment, content);