当我发送一个GET请求来检索某些ID / posts的数据时,比如
https://graph.facebook.com/microsoft/posts?fIElds=comments,likes\u0026amp;limit=1\u0026amp;access_token=,无法使用我自己生成的访问令牌获取“赞”和“评论”字段中的“计数” Facebook注册的应用程序,但如果使用来自Facebook示例应用程序的访问令牌,可以获得预期的数据,例如“HelloFacebookSample”.
AndroID和FB Graph API Exploer上都会出现此问题.另外,为了解决可能的原因,我使用了与我注册的app_ID下的FB示例完全相同的代码,但同样的问题又出现了.所以我能想到的唯一可能的解释是FB app_ID的一些奇怪的事情,而不是权限范围或不同的用户(我已经使用两个用户测试过).
这是来自https://graph.facebook.com/microsoft/posts?fIElds=likes\u0026amp;limit=1\u0026amp;access_token=的GET请求的回复:
1.使用app_ID生成的access_token:
{ "data": [ { "ID": "20528438720_10151574758413721","created_time": "2013-07-18T18:41:51+0000","likes": { "data": [ { "ID": "701134683","name": "Someone's name" },{ "ID": "113770258795376","name": "Someone's name" } /****and so on****/ ],"paging": { "cursors": { "after": "MTAwMDAwNjkxNDMxMTcz","before": "NzAxMTM0Njgz" },"next": "https://graph.facebook.com/20528438720_10151574758413721/likes?limit=25&after=MTAwMDAwNjkxNDMxMTcz" } } } ],"paging": { "prevIoUs": "https://graph.facebook.com/20528438720/posts?fIElds=likes&limit=1&since=1374172911","next": "https://graph.facebook.com/20528438720/posts?fIElds=likes&limit=1&until=1374172910" }}
2.使用FB的示例app_ID生成的access_token(这里可以获得喜欢的“计数”):
{ "data": [ { "likes": { "data": [ { "name": "Someone's name","ID": "100003531173993" },{ "name": "Someone's name","ID": "100002299390558" },"ID": "1038509978" },"ID": "1615491698" } ],"count": 1071 },"ID": "20528438720_10151574758413721","created_time": "2013-07-18T18:41:51+0000" } ],"next": "https://graph.facebook.com/20528438720/posts?fIElds=likes&limit=1&until=1374172910" }}
这真的让我困惑了好几天,而且我已经做了很多搜索,但找不到任何有用或相关的信息,可能是因为我的英语:P.还有其他人面临类似的问题吗?
谢谢你的阅读.
任何帮助或替代解决方案赞赏! (在这里,我只想在我的应用中显示喜欢的数量)
解决方法 刚刚找到了解决方案,这完全归功于FB的 the October 2013 Breaking Changes迁移.他们改变了POST_ID / likes格式,但可能还没有完成迁移,所以存在一些不一致的地方.以下是我从Facebook Developer Alert获得的官方声明.POST_ID/likes format will change. Apps will be able to retrIEve all likes on a post (rather than the first 4 as it is today) through paging. As a result of the functionality update,the like count will be moved to the summary fIEld.
现在,如果您无法在“赞”或“评论”字段中看到“计数”,请按照以下步骤 *** 作:
>发送GET请求,让我们说https://graph.facebook.com/microsoft/posts?fIElds=likes\u0026amp;limit=1\u0026amp;access_token=然后你得到POST_ID =“ID”
>对https://graph.facebook.com/POST_ID/likes?summary=true\u0026amp;access_token=的新GET请求,然后您将在“摘要”字段中找到“赞”的“total_count”.
希望这可以帮助!
总结以上是内存溢出为你收集整理的android – 无法使用我自己的注册应用程序的access_token在“赞”和“评论”字段中获得“计数”全部内容,希望文章能够帮你解决android – 无法使用我自己的注册应用程序的access_token在“赞”和“评论”字段中获得“计数”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)