android - 如何以编程方式从 Android 将文本放入 "Say something about this..."facebook 文本框中

标签 android share facebook-sdk-4.0 facebook-sharer hint

我正在从 Android 应用程序在 Facebook 上分享图像。我可以在 Facebook 上查看我分享的图片。但是,我需要以编程方式在 Android 的“说点什么”文本框中写入文本。我不知道如何通过 facebook SDK 实现这一点。我正在使用 facebook SDK v4。

enter image description here

最佳答案

Facebook 不允许使用 SDK 或 Intent 发布文本。

来自 Facebook 文档

When you implement sharing, your app should not pre-fill any content to be shared. This is inconsistent with Facebook Platform Policy, see Facebook Platform Policy, 2.3.

  1. Don't prefill captions, comments, messages, or the user message parameter of posts with content a person or business didn’t create, even if the person can edit or remove the content before sharing. You may use our Share Dialogs to prefill a single hashtag in a post, but don't prefill any content a person or business didn't create via the API.

您可以指定与共享照片、链接或视频一起显示的单个主题标签。此主题标签也会出现在“共享”对话框中,人们有机会在发布之前将其删除。

以下是将主题标签添加到链接共享的示例。

ShareLinkContent content = new ShareLinkContent.Builder()
    .setContentUrl(Uri.parse("https://developers.facebook.com"))
    .setShareHashtag(new ShareHashtag.Builder()
            .setHashtag("#ConnectTheWorld")
            .build());
    .build();

注意:此(标签)附加功能仅在您使用 Facebook 时可用 Share Dialog .

更多详情请引用https://developers.facebook.com/docs/sharing/android

关于android - 如何以编程方式从 Android 将文本放入 "Say something about this..."facebook 文本框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41761566/

相关文章:

带有自定义标题、描述和图像的 Facebook 共享按钮

ios - Facebook SDK v4 和解析 (Swift)

ios - PFFacebookUtils logInInBackgroundWithReadPermissions : block: opens Facebook app instead of using system account

android - Mobilefirst 7.1 中带有状态栏的推送通知

启用 Jacoco 时,具有默认方法的 Java 8 接口(interface)不起作用

android - 在eclipse中的项目之间共享代码

ios - 来自 UIActivityItemSource 的多个数据

python - Facebook-sdk python 模块没有属性 GraphAPI

android - setAlarmClock(信息,pi);作为 setRepeating() 工作

android - 如何将 Mat 数组从 JNI 返回到 Java