/(userid)/ likes /(pageid)返回不完整的结果(/(userid)/likes/(pageid) returns incomplete results)

编程入门 行业动态 更新时间:2024-10-24 01:49:27
/(userid)/ likes /(pageid)返回不完整的结果(/(userid)/likes/(pageid) returns incomplete results)

我正在尝试完成以下操作:在客户的主页(Facebook应用程序)上,在用户使用Facebook登录后,应该有覆盖,但仅当用户没有“喜欢”客户的Facebook页面时(这与我正在创建的应用程序不同 )。 在这个叠加层上,客户的Facebook页面应该有一个类似的按钮。

我想我可以使用图形api,访问/(userid)/likes/(pageid) 。 但是,即使我“喜欢”页面,我也收到了空洞的结果。

如果我访问/(userid)/likes ,我只得到两个结果。 这两个是我“喜欢”的页面,但这两个页面没有出现在我的脸书帐户中的“其他喜欢”之下。 “其他喜欢”下的页面(客户页面是其中之一)但是不会出现在api调用的结果中。

有趣的是,无论是否添加了“user_likes”权限 ,我总是在结果中得到这两个页面。 我通过调用/(userid)/permissions进行了双重检查,并正确识别权限设置。

有任何想法吗? 谢谢!

I'm trying to accomplish the following: On a homepage of a customer (a Facebook app), after the user has logged in with Facebook, there should be an overlay, but only if the user has not "liked" the customer's Facebook page (which is different from the app that I'm creating). On this overlay, there should be a like button for the customers Facebook page.

I figued I could do this with the graph api, accessing /(userid)/likes/(pageid). However, I recieve an empty result, even though I "like" the page.

If I access /(userid)/likes, I get only two results. These two are pages that I "liked", but those two do not show up in my facebook account under "other likes". The pages under "other likes" (the customers page is one of them) however do not show up in the result of the api call.

The funny thing is, I get always get these two pages in the result, regardless if I added the "user_likes" permission. I double checked with calling /(userid)/permissions, and the permissions settings are recognized correctly.

Any ideas? Thanks!

最满意答案

您需要拥有“user_likes”权限,然后您可以在FQL中执行以下操作:

select uid, page_id from page_fan where uid=me() and page_id={YOUR_PAGE_ID}

如果您没有收到空结果,则用户会喜欢您的页面。

如果您的应用程序是页面选项卡应用程序,您还可以使用SignedRequest的字段“页面”,如下所述: https : //developers.facebook.com/docs/reference/login/signed-request/

You need to have the permission "user_likes", then you could do something like the following in FQL:

select uid, page_id from page_fan where uid=me() and page_id={YOUR_PAGE_ID}

If you don't receive an empty result, the user likes your page.

If your App is a Page Tab App, you could also use the field "page" of the SignedRequest as described here: https://developers.facebook.com/docs/reference/login/signed-request/

更多推荐

本文发布于:2023-07-05 06:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034371.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不完整   pageid   likes   userid   incomplete

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!