Facebook 图形 API:json 响应中缺少提要 [英] Facebook graph API: feeds missing in json response

查看:15
本文介绍了Facebook 图形 API:json 响应中缺少提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从我的 Android 应用程序中通过图形 API 获取用户的提要.它通常有效,但我在墙上看到的一些提要在 json 响应中丢失了.

我调用网址

当我将 access_token 添加到 url 时,我收到了丢失"的提要 - 但为什么呢?发布的提要对所有人"有隐私设置?!

这是我在使用 access_token 时得到的缺失提要:

{"id":"504063796_485195138796","from":{"name":"Mathias Lin","id":"504063796"},"message":"Android 上传照片测试","图片":"http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/hs021.snc6/165194_485195123796_504063796_6062399_1841907""jpg/"http:"jpgwww.facebook.com/photo.php?fbid=485195123796&set=a.485195118796.256450.504063796","name":"Torres Photos","icon":"http://st​​atic.ak.fbcdn.net/rsrc.php/yz/r/StEh3RhPvjk.gif","actions":[{"name":"Comment","link":"http://www.facebook.com/504063796/posts/485195138796"},{"name":"Like","link":"http://www.facebook.com/504063796/posts/485195138796"}],"隐私":{"description":"Everyone","value":"EVERYONE"},"type":"photo","created_time":"2011-01-06T05:10:43+0000","updated_time":"2011-01-06T09:00:23+0000","likes":6,"comments":{"data":[{"id":"504063796_485195138796_3607414","from":{"name":"Mathias Lin","id":"504063796"},"message":"太棒了,照片上传现在也能用了.使用 Faceboo 不是很有趣k SDK for Android,除了非常非常简单的图形 API 包装器之外,还期望有更多功能.但需要考虑的是,android sdk 开发是实习的一部分 - 但由于它是开源的,幸运的是可以对其进行修改.由于一些错误(混淆了帖子、getString、getByteArray 的捆绑参数),必须这样做.Api 文档可以改进.","created_time":"2011-01-06T05:26:04+0000"},{"id":"504063796_485195138796_3608020","from":{"name":"Renate Hermanns""id":"628810487"},"message":"哇,时间过得有多快.你女儿快长大了 ;-)","created_time":"2011-01-06T09:00:23+0000"}],"count":2},"attribution":"Torres"}

我已经将问题发布到 FB 开发论坛,等待回复.

相关主题:

http://forum.developers.facebook.net/viewtopic.php?id=81365

http://forum.developers.facebook.net/viewtopic.php?id=75984

Facebook 图谱 API /userid/feed"返回空白

解决方案

你的方法是正确的,我已经看到了 JSON,是的,它缺少第二个,我认为它是上传应用程序表单 adroid,请尝试检查应用程序设置这个应用程序.或者,如果您尝试检索墙 FQL 是一种更好的方法

SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id in (SELECT target_id FROM connection WHERE source_id= AND is_following=1) AND is_hidden = 0

I try to fetch user's feeds via graph api from my Android application. It generally works but some feeds that I can see on the wall are missing in the json response.

I call the url http://graph.facebook.com/someUserId/feed, by using the Android Facebook SDK methods, so the access token should be provided automatically, but it's not really relevant I think in my case. Nevertheless fyi, the user of my app is authenticated via OAuth.

I already checked the following:

  • all the user's feeds are visible to everyone / public (set in privacy settings)
  • the json response is not cached by my browser
  • I am aware of paging, but this is not an issue. The problem is not that I am not getting the very oldest feeds but that some feeds are just missing in between.
  • I registered a new facebook user which is not connected to the user I want to retrieve the wall feeds from, and when I open the respective wall I see all the feeds there, as expected, since they're all public to everyone. Yet, when I open the same related json url unter http://graph.facebook.com/someUserId/feed, some feeds are missing.

This is an example of the problem - since all my posts are public, I can just call the json url directly in a browser to do a test.

I want to get wall feeds from user: http://www.facebook.com/mathias.lin

Screenshot1: note the 3 marked postings, all posted by myself

and here the json response, as you can see, the 1st and 3rd wall posts are included in the json, but the 2nd post is not. Why?

The related json url is: http://graph.facebook.com/mathias.lin/feed

I am getting the 'missing' feed when I add an access_token to the url - but why? The posted feed has a privacy setting for 'everyone'?!

This is the missing feed that I get when using the access_token:

{"id":"504063796_485195138796","from":{"name":"Mathias Lin","id":"504063796"},"message":"Photo test upload from Android","picture":"http://photos-e.ak.fbcdn.net/hphotos-ak-snc6/hs021.snc6/165194_485195123796_504063796_6062399_1841907_s.jpg","link":"http://www.facebook.com/photo.php?fbid=485195123796&set=a.485195118796.256450.504063796","name":"Torres Photos","icon":"http://static.ak.fbcdn.net/rsrc.php/yz/r/StEh3RhPvjk.gif","actions":[{"name":"Comment","link":"http://www.facebook.com/504063796/posts/485195138796"},{"name":"Like","link":"http://www.facebook.com/504063796/posts/485195138796"}],"privacy":{"description":"Everyone","value":"EVERYONE"},"type":"photo","created_time":"2011-01-06T05:10:43+0000","updated_time":"2011-01-06T09:00:23+0000","likes":6,"comments":{"data":[{"id":"504063796_485195138796_3607414","from":{"name":"Mathias Lin","id":"504063796"},"message":"Awesome, photo upload now works as well. Not so much fun working with the Facebook SDK for Android, would have expected more functionality beyond that just very very simple graph api wrapper. But need to be considered that the android sdk development was part of an internship - but since it's it's open source, it can luckily be modified. Which has to be done due to some bugs (mixing up the bundle parameters for a post, getString, getByteArray). Api documentation could be improved.","created_time":"2011-01-06T05:26:04+0000"},{"id":"504063796_485195138796_3608020","from":{"name":"Renate Hermanns","id":"628810487"},"message":"Wow
, how fast time passes by. Your daughter is nearly grown up ;-).","created_time":"2011-01-06T09:00:23+0000"}],"count":2},"attribution":"Torres"}

I've already posted the question to the FB dev forum, awaiting response.

Related threads:

http://forum.developers.facebook.net/viewtopic.php?id=81365

http://forum.developers.facebook.net/viewtopic.php?id=75984

Facebook Graph API "/userid/feed" returning Blank

解决方案

Your approach is correct, I've seen the JSON and yes it's missing the second one, I think it's upload app form adroid, try checking the application settings for this app. Or If your trying to retrieve the wall FQL is a much better way

SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id in (SELECT target_id FROM connection WHERE source_id=<uid> AND is_following=1) AND is_hidden = 0 

这篇关于Facebook 图形 API:json 响应中缺少提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆