I want to read my friends posts (feeds?, all posts but for a specific user only) from his user wall.
I need all (posts, feeds, statuses) that i see when i look at his page directly from the website.
I use the android sdk and i tried the graph api and rest method.
My app is registered and i have logged in facebook to get the access token (permission: read_stream)
but i dont get that infos that want to.
Please help.
Thx.
How about testing your Graph API call in the Graph API Explorer?
https://developers.facebook.com/tools/explorer/
In my case, I could get my first 10 friends' feed (wall) with the url https://graph.facebook.com/me?fields=friends.limit(10).fields(feed)
Note that I used field expansion of the Graph API.
http://developers.facebook.com/docs/reference/api/field_expansion/
You need them to actually use your app and grant full permissions via the graph API.
You cannot simply 'grab a friends wall'. You must do that via your app and it needs the permissions to do so from the user in question.
Related
Say i am the owner of the page "ABC" and there is an album on that page, called "XYZ" and this app is only for one person, me.
I want to upload a picture to "XYZ".
So first thing i need to do is login using the Facebook account who owns the page.
Second i need publish_pages permission? Is that so? How do i get the permissions. And once i get the permissions, how do i post the picture to that album? Can anyone tell me how to do this ?
You need manage_pages and publish_pages
You need to use a Page Token of that Page
Use the /album/photos endpoint to post a photo: https://developers.facebook.com/docs/graph-api/reference/v3.3/album/photos#publish
Additional information about the Graph API in general and login: https://developers.facebook.com/docs/graph-api/using-graph-api
I am trying to get permission to access user's public profile so I can provide a link to this person's profile to other people using an app.
within the api response, we have a "link", but it is a https://facebook.com/... link, and not some intent link like fb://profile/<id>
So how can I create this link without global user id and username?
I also tried to use fb://facewebmodal/f?href=<link> but it redirects me to my own facebook home page (feed)
Thank you!
Dhiogo's anwser is not working anymore. Facebook's API retrieves an user_id when the user authenticates within your application. So all you have to do is use this user_id like this:
fb://facewebmodal/f?href=https://www.facebook.com/profile.php&user_id=[user_id]
This is a closed bug that Facebook didn't fixed: https://developers.facebook.com/bugs/332195860270199
But I could find a solution!!! All you have to do is to get the scoped link that facebook graph api generates (link permission) and replace the https://facebook.com/app_scoped_user_id/ with fb://profile/?app_scoped_user_id/ leaving the rest of the link as it is.
I hope this can help you.
I use facebook login in my app. Once the users are logged-in I can get their basic facebook info such as display name, email, and phot url.
I'd like to get their facebook friends list. I think I can get it "directly" with firebase but I don't remember how and I cannot find any info about it. I think I first have to tell Firebase to get friends list when people login with facebook, then I sould be able to get it with a method such as firebaseAuth.getCurrentUser().getFriendList().
Do you know how to get facebook friends list with firebaseAuth ?
Thank you,
Alex
It is feasible, but only the friends that also use your app. The trick is to add a scope to your login method. In Angular it looks like this
this.afAuth.auth.signInWithPopup(new firebase.auth.FacebookAuthProvider().addScope('user_friends'))
That scope at the end is the trick. Then, you need at least two users that are friends on facebook to login. You will note the popup is different as it now asks permission for the user's friends.
The response will include an access token. Then you can use that token to request the user's friends that are also using the app with a GET request like this
https://graph.facebook.com/v2.11/{facebook_uid}/?fields=friends{name,id}&access_token={access_token}
Note I'm using a particular version, but you should change that to whatever you need.
generally obtaining user's all friends list from Facebook is not possible, they removed this option years ago, with API v2.0 introduction... more info about and useful suggestions HERE
there is an official FB API called Graph API and HERE you have some doc about friend lists
and the Firebase... well, this is Google's product and it have nothing to do with Facebook... You are probably using FB mail address for creating an account in Firebase service/database, but it is keeping only this data plus some additional attributes if set (like photo or visible name).
firebaseAuth.getCurrentUser() returns FirebaseUser object, which have THESE methods - like you see: logpass, name, photo url and only few more methods. no option for getting friends list, because there is no method to set them, and no possibility to get this list from FB lib/API
How to get feeds(photos only) of a certain Facebook page via Facebook API for android?
is there a straight forward method for that.
Exactly what I need is an activity that shows feeds of photos from a certain page. that why I think this doesn't require login' in. Can I do that? and HOW?
For a page, whose photos are public you can fetch them without login without any access token, using /PAGEID/photos. For eg: http://graph.facebook.com/cocacola/photos
If you want the public feeds pf a page, you can fetch them too, without the login using the App Access Token, which you can get using the \GET request to :
/oauth/access_token?
client_id={app-id}
&client_secret={app-secret}
&grant_type=client_credentials
and use this token to query the feeds using /PAGEID/feed. For Eg: http://graph.facebook.com/cocacola/feed?access_token=APP_ACCESS_TOKEN
(I think you need the Photos not the Feeds; to which you are saying Feeds of Photos)
If you are new to facebook integration: How to Integrate Facebook Connect with Android
Try using graph api
http://graph.facebook.com/pagename?fields=photos.fields(images)
For more options check the docs
I am using the facebook API in my app, i know how to post message on wall. my requirement is, i want read the wall information of user recent status information through code .
How can i achieve this...
for example. from my facebook account i want to get the latest status information.
Here's a great example of using the GraphAPI to do that
https://graph.facebook.com/me/feed?access_token={}
Try it out here: https://developers.facebook.com/tools/explorer
EDIT
I stumbled across this the other day. There's a connection from the user object called statuses, which filters the stream even more than feed. As with many graph calls, you can add ?limit=N to limit the result set. So this new way I discovered would look like:
https://graph.facebook.com/me/statuses?limit=1&access_token={}
You should use a third party API such as Easy Facebook SDK. It allows you to do what you are trying to do with ease.
U should check it out here:
http://developers.facebook.com/blog/post/385/