在 fb.api 状态更新中标记朋友?

发布于 2024-09-26 02:33:58 字数 124 浏览 1 评论 0原文

是否可以使用 Facebook fb.api (JavaScript SDK) 调用以某种方式标记朋友?

我所说的标记是指当您在常规 facebook.com UI 中使用“@”时会发生什么。

Is it possible to tag friends somehow using the Facebook fb.api (JavaScript SDK) call?

By tagging I mean what happens when you use "@" in the regular facebook.com UI.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

才能让你更想念 2024-10-03 02:33:58

目前无法在状态更新中标记好友或通过 API 发帖。

It is currently not possible to tag a friend in a status update or post via the API.

暖伴 2024-10-03 02:33:58

不确定这是否是您要问的,但使用 Facebook API 标记朋友的语法是 @[uid:friend name]。不过目前好像有bug,FB不支持。

Not sure if that's what you are asking, but the syntax to tag a friend using Facebook API is @[uid:friend name]. However, it seems like there is a bug at the moment and FB does not support it.

泪眸﹌ 2024-10-03 02:33:58

有关详细信息,请查看 Facebook 文档:photos.addTag

引用:

列表中的每个标记都必须指定:“x”、“y”以及标识被标记人员的用户 ID“tag_uid”或自由格式“tag_text”。例如字符串 {"x":"70.0","y":"70.0","tag_text":"some person"}

并在 FB.api 了解如何使用 JavaScript 进行 REST API 调用。

Check the Facebook documentation for more information about this: photos.addTag.

Quote:

Each tag in the list must specify: "x", "y", and either the user id "tag_uid" or free-form "tag_text" identifying the person being tagged. An example of this is the string {"x":"70.0","y":"70.0","tag_text":"some person"}

And read in FB.api on how to use the REST API calls using JavaScript.

花开雨落又逢春i 2024-10-03 02:33:58

是的,您可以使用 FB.api 来标记好友。

例如,如果您想用要在 Facebook 墙上分享的消息标记朋友,则必须执行以下操作。

1) 获取扩展权限 ('publish_stream'),例如您可以在登录应用程序时请求它 FBUser.login({scope: 'publish_stream'});

2) 您必须将带有 facebook_user_id 的字符串传递给 api 对象的“tag”键。例如

FB.api('me/feed', 'post', {
消息:“我的消息在这里”,
place: '123456789', // 强制!!!
Tags: "123456, 654321, 147258, 852963", // 您朋友的 facebook 用户 ID
name : "这里有一些文字",
描述:“这里有一些文字”,
图片:“http://wwww.link.to/the_image"})

Yes, you can use FB.api to tag a friends.

E.g. If you would like to a tag a friend(s) withing a message that you will share on a Fb's wall you have to do following.

1) Get extended permissions ('publish_stream') e.g. you can request it while login to the app FBUser.login({scope: 'publish_stream'});

2) You have to pass a string with the facebook_user_id to a 'tag' key of the api object. e.g.

FB.api('me/feed', 'post', {
message: "my message here",
place: '123456789', // mandatory!!!
tags: "123456, 654321, 147258, 852963", // facebook users ids of your friends
name : "Some text here",
description : "Some text here",
picture: "http://wwww.link.to/the_image"})

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文