我使用facebook样本进行故事发布:
public static void postStory(Activity activity) {
String fbAppId = activity.getString(R.string.facebook_app_id);
ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("fb:app_id", fbAppId)
.putString("og:type", "books.book")
.putString("og:title", "A Game of Thrones")
.putString("og:description", "In the frozen wastes to the north of Winterfell, sinister and supernatural forces are mustering.")
.putString("books:isbn", "0-553-57340-3")
.build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType("books.reads")
.putObject("book", object)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("book")
.setAction(action)
.build();
boolean canShare = new ShareApi(content).canShare();
ShareDialog.show(activity, content);
ShareApi.share(content, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Log.d(TAG, result.toString());
}
@Override
public void onCancel() { }
@Override
public void onError(FacebookException e) {
Log.d(TAG, e.toString());
}
});
}
canShare()返回true, ShareDialog 工作得非常好,但 ShareApi 返回:
{FacebookGraphResponseException:无效的参数httpResponseCode: 500,facebookErrorCode:100,facebookErrorType:FacebookApiException, 消息:参数无效}
可能是什么问题?