我正在从 Android 应用程序在 Facebook 上分享图像。我可以在 Facebook 上查看我分享的图片。但是,我需要以编程方式在 Android 的“说点什么”文本框中写入文本。我不知道如何通过 facebook SDK 实现这一点。我正在使用 facebook SDK v4。
最佳答案
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.
- 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 .
关于android - 如何以编程方式从 Android 将文本放入 "Say something about this..."facebook 文本框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41761566/