显式共享不适用于后Facebook Android SDK开放图故事
我目前正在使用FacebookAndroidSDK3.19.1将一个开放的图表故事发布到我们用户的时间线上 故事会添加到用户的活动日志中,但不会显示在用户的时间线上 我的故事有一个自定义的动作和对象,我为我的动作和代码中相应的属性设置了“显式共享”选项。我还提交并获得了“发布行动”许可 我是不是遗漏了什么显式共享不适用于后Facebook Android SDK开放图故事,android,facebook,facebook-graph-api,facebook-android-sdk,facebook-timeline,Android,Facebook,Facebook Graph Api,Facebook Android Sdk,Facebook Timeline,我目前正在使用FacebookAndroidSDK3.19.1将一个开放的图表故事发布到我们用户的时间线上 故事会添加到用户的活动日志中,但不会显示在用户的时间线上 我的故事有一个自定义的动作和对象,我为我的动作和代码中相应的属性设置了“显式共享”选项。我还提交并获得了“发布行动”许可 我是不是遗漏了什么 private void postGraph(final Bundle b, final Request.Callback callback) { // Set up the req
private void postGraph(final Bundle b, final Request.Callback callback) {
// Set up the request callback to handle errors
Request.Callback errorCallback = new Request.Callback() {
@Override
public void onCompleted(Response response) {
// Log any response error
FacebookRequestError error = response.getError();
if (error != null) {
callback.onCompleted(response);
Log.i("PostGraph", error.getErrorMessage());
}
}
};
// Create a batch request
RequestBatch requestBatch = new RequestBatch();
// Request: Staging image upload request
// --------------------------------------------
boolean hasImage = b.containsKey(BUNDLE_PICTURE);
// If uploading an image, set up the first batch request
// to do this.
if (hasImage) {
// Set up image upload request parameters
Bitmap image = BitmapFactory.decodeFile(b.getString(BUNDLE_PICTURE));
// Create the request for the image upload
Request imageRequest = Request
.newUploadStagingResourceWithImageRequest(Session.getActiveSession(),
image, errorCallback);
// Set the batch name so you can refer to the result
// in the follow-on object creation request
imageRequest.setBatchEntryName("imageUpload");
// Add the request to the batch
requestBatch.add(imageRequest);
}
// Request: Object request
// --------------------------------------------
// Set up the OpenGraphObject representing the book.
OpenGraphObject obj = OpenGraphObject.Factory.createForPost(mGraphObjectName);
if (hasImage) {
obj.setImageUrls(Arrays.asList("{result=imageUpload:$.uri}"));
}
if (b.containsKey(BUNDLE_NAME)) {
obj.setTitle(b.getString(BUNDLE_NAME));
}
if (b.containsKey(BUNDLE_LINK)) {
obj.setUrl(b.getString(BUNDLE_LINK));
}
if (b.containsKey(BUNDLE_MESSAGE)) {
String message = b.getString(BUNDLE_MESSAGE);
if (!TextUtils.isEmpty(message)) {
obj.setDescription(b.getString(BUNDLE_MESSAGE));
obj.setProperty("message", b.getString(BUNDLE_MESSAGE));
}
}
// Create the request for object creation
Request objectRequest = Request.newPostOpenGraphObjectRequest(Session.getActiveSession(),
obj, errorCallback);
// Set the batch name so you can refer to the result
// in the follow-on publish action request
objectRequest.setBatchEntryName("objectCreate");
// Add the request to the batch
requestBatch.add(objectRequest);
// Request: Publish action request
// --------------------------------------------
OpenGraphAction postAction = OpenGraphAction.Factory.createForPost(mGraphActionName);
// Refer to the "id" in the result from the previous batch request
postAction.setProperty("object", "{result=objectCreate:$.id}");
postAction.setExplicitlyShared(true);
postAction.setProperty("explicitly_shared", "true");
// Create the publish action request
Request actionRequest = Request.newPostOpenGraphActionRequest(Session.getActiveSession(),
postAction, callback);
// Add the request to the batch
requestBatch.add(actionRequest);
// Execute the batch request
requestBatch.executeAsync();
}
我联系了Facebook的支持团队,得到了以下回复: 这是故意的。明确地指用户决定分享一个故事的事实。该共享保证会显示在用户的新闻提要上,但不会显示在用户的时间线上 正如您所提到的,它确实会显示在活动日志中,然后他们可以通过将所选选项从“时间线上允许”更改为“时间线上显示”来选择特定故事的下拉列表 所以,我的问题显然不是问题 <>但是,我仍然认为功能有点混乱。我认为“显式共享”帖子会出现在用户的时间线上,如果没有选中“显式共享”选项,它会有上述行为。我想我的问题只是语义学