1

我可以将 ShareOpenGraphContent 用于 MessageDialog 吗?

当我创建一个带有 ShareOpenGraphAction 和 ShareOpenGraphObject 的 ShareOpenGraphContent 并使用 ShareDialog.show() 发布它时,它可以工作。朋友可以看到帖子。

但是当我创建相同的内容并使用 MessageDialog.show() 作为消息发送给朋友时,它会显示附件不可用。

这是我创建内容的代码:

// Builds the object    
    ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
            .putString("fb:app_id", my_app_ID)
            .putString("og:url", link_to_site)
            .putString("og:type", objectType)
            .putString("og:title", contentTitle)
            .putString("og:description", contentDescription)
            .putString("og:image", imageLink)
            .build();

// Builds the action
        ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
                .setActionType(actionName)
                .putObject(objectName, object)
                .build();

// Create the openGraphContent
        ShareOpenGraphContent openGraphContent = new ShareOpenGraphContent.Builder()
                .setPreviewPropertyName(objectName)
                .setAction(action)
                .build();

        return openGraphContent;

我将该代码用于 ShareDialog.show() 和 MessageDialog.show()

4

0 回答 0