I use ShareDialog for Facebook to share the printScreen image on facebook in my application.
When the Facebook application is installed, it works well.
If the Facebook application is not installed , it does not work. I see the loading screen and then it disappears and nothing happens. The share dialog object reaches the onError callback with a FacebookException:
{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions}
So do I really need permission to publish_actions for the facebook website only and not for the facebook application? strange ..
Facebook writes:
https://developers.facebook.com/docs/sharing/android
"If the Facebook app is not installed it will automatically fallback to the web-based dialog"
"Now the SDK automatically checks for the native Facebook app. If it isn't installed, the SDK switches people to their default browser and opens the Feed Dialog."
my code is:
mShareDialog = new ShareDialog(mActivity);
mShareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {}
@Override
public void onCancel() {}
@Override
public void onError(FacebookException error) {
if (error != null) {
showDialog("facebook app isn't installed");
}
}
});
if (ShareDialog.canShow(ShareLinkContent.class)) {
Bitmap image = getScreenshot();
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(image)
.setCaption(getResources().getString(R.string.shareBodyText))
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
mShareDialog.show(content);
}
, facebook "publish_actions" , facebook ?