I am developing an android App and want to incorporate Facebook in it. I have an App ID and the Facebook Library is added to my project. I want to retrieve the post from my NewsFeed that says that a friend of mine has uploaded new pictures. I can see that post in my NewsFeed both on my mobile Facebook app and on web at my PC but when i try to recover a string using following relevant code:
private static final String[] PERMS = new String[] {"user_events", "friends_events", "user_photos", "friends_photos", "friends_activities", "friends_videos",
"email", "publish_stream", "read_stream"};
private Facebook mFacebook;
private AsyncFacebookRunner mAsyncRunner;
.........
mFacebook = new Facebook(APP_ID);
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
.........
mFacebook.authorize(this, PERMS, new DialogListener()
{
.........
}
.........
{
mAsyncRunner.request("me/home", new UserNewsFeedListener(), "newsfeedForPhotos");
}
I th开发者_开发知识库en print the resulting response string in UserNewsFeedListener()'s onComplete() method. I get all the posts that I made on my wall and the posts my friend made on my wall that were appearing in newsfeed but the post showing pictures uploaded by my friend is not showing up in the resulting response string.
I also tried using FQL but i got the same result. Please help. Am I doing something wrong? Can I get this post information and then use it to get those pictures of my friend?
Any help will be appreciated. Thanks.
you are doing the right thing and the photo posts should show up. I just tested it on my sample app with the me/home graph path and it correctly shows the photos that my friends uploaded:
{
"id": "100001742041368_187606011307466",
"from": {
"name": "Vikas Fbone",
"id": "100001742041368"
},
"picture": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/300204_187605997974134_100001742041368_424627_3637528_s.jpg",
"link": "https://www.facebook.com/photo.php?fbid=187605997974134&set=a.121410007927067.19689.100001742041368&type=1",
"name": "Wall Photos",
"icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/100001742041368/posts/187606011307466"
},
{
"name": "Like",
"link": "https://www.facebook.com/100001742041368/posts/187606011307466"
}
],
"type": "photo",
"object_id": "187605997974134",
"created_time": "2011-08-29T20:58:24+0000",
"updated_time": "2011-08-29T20:58:24+0000",
"comments": {
"count": 0
}
},
{
"id": "100001742041368_187605864640814",
"from": {
"name": "Vikas Fbone",
"id": "100001742041368"
},
"picture": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/311649_187605844640816_100001742041368_424626_663667_s.jpg",
"link": "https://www.facebook.com/photo.php?fbid=187605844640816&set=a.121410007927067.19689.100001742041368&type=1",
"name": "Wall Photos",
"icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/100001742041368/posts/187605864640814"
},
{
"name": "Like",
"link": "https://www.facebook.com/100001742041368/posts/187605864640814"
}
],
"type": "photo",
"object_id": "187605844640816",
"created_time": "2011-08-29T20:58:07+0000",
"updated_time": "2011-08-29T20:58:07+0000",
"comments": {
"count": 0
}
},
Do you see other posts from your same friend? If not, he may have blocked access to Facebook platform and any of his posts won't show up. The platform can be enabled by visiting Account->Privacy Settings->Edit your Settings (under Apps and Websites at the bottom right)->Apps you see - Turn on all platform.
精彩评论