facebook sdk 权限不足,无法通过 Api 共享内容
facebook sdk Insufficient permissions for sharing content via Api
在我的应用程序中有一个基本的照片编辑器,我希望用户分享这些照片以分享到 Facebook,AFAIK,Facebook 分享不需要 publish_actions 批准。我这样使用共享 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 共享内容的权限不足。 有人知道问题是什么以及如何解决吗?
您现在正在使用自定义界面的代码 (ShareApi.share
):
If you want to use your own interface for sharing, you need to: ... Request the publish_actions permission when people log into your app
来源:https://developers.facebook.com/docs/sharing/android
看看文档,这可能是您需要的:
ShareDialog.show(activityOrFragment, content);
在我的应用程序中有一个基本的照片编辑器,我希望用户分享这些照片以分享到 Facebook,AFAIK,Facebook 分享不需要 publish_actions 批准。我这样使用共享 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 共享内容的权限不足。 有人知道问题是什么以及如何解决吗?
您现在正在使用自定义界面的代码 (ShareApi.share
):
If you want to use your own interface for sharing, you need to: ... Request the publish_actions permission when people log into your app
来源:https://developers.facebook.com/docs/sharing/android
看看文档,这可能是您需要的:
ShareDialog.show(activityOrFragment, content);