为了我的应用程序中共享在Facebook上PRINTSCREEN像我使用了Facebook的ShareDialog。Facebook的shareDialog是未安装应用程序时 - 怪异的行为?
当安装Facebook应用程序,它工作正常的。
当Facebook应用程序不安装,这是行不通的。我看到“加载”屏幕,然后消失,没有任何反应。 份额对话对象达到的onError与FacebookException回调:
{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions}
所以我真的只需要为Facebook网页而不是Facebook应用程序“publish_actions”权限?奇怪..
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."
我的代码:当Facebook应用程序是没有 “publish_actions” 安装不当Facebook工作
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)) {
// get a screenshot
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);
}
那么,为什么它的工作原理应用程序未安装?