gpt4 book ai didi

android - 如何创建超链接文本消息以在 android 中的 facebook 墙上发布

转载 作者:行者123 更新时间:2023-11-29 02:02:28 26 4
gpt4 key购买 nike

嗨,我需要在 facebook 墙上发布消息,消息中包含超链接。我尝试了以下代码

    Bundle parameters = new Bundle();
parameters.putString("message",message);
parameters.putString("attachment", "{\"name\":\""+"seriesname"+"\","
+"\"href\":\""+"http://www.google.com\","+"\"description\":\""+"sampledescriptinnn"+"\"}");
parameters.putString("description","Testing.....");
response = mFacebook.request("me/feed", parameters,"POST");

我可以在墙上发布消息,但永远不会显示超链接。任何人都可以告诉我实现此目的的正确方法是什么。谢谢。

最佳答案

这是来自 PHP SDK 的示例,您可以找到 here在标题为“使用图形 API 将链接发布到用户墙上”的第三个示例框中。

他们打电话

        $ret_obj = $facebook->api('/me/feed', 'POST',
array(
'link' => 'www.example.com',
'message' => 'Posting with the PHP SDK!'
));

所以我建议遵循相同的格式,并有一个 Bundle,其中包含一个带有 URL 的“链接”和一个带有您想要作为描述的消息的“消息”,例如

Bundle params = new Bundle();
params.putString("link", "www.google.com");
params.putString("message", Testing.....");
response = mFacebook.request("me/feed", parameters, "POST");

请尝试一下,如果您仍然有任何问题,请告诉我们。

关于android - 如何创建超链接文本消息以在 android 中的 facebook 墙上发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11902582/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com