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
Related
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
I want to show(and only show) the news feed of some different facebook-sites.
In my case it is all about icehockey: i want to show the newsfeed of some differnet sites like:
https://www.facebook.com/penguins/?fref=ts
https://www.facebook.com/groups/305981342861167/?fref=ts
i am not the owner of the sites!
i only want to show the newsfeed (no comments, likes..)
authentication should NOT be necessary in my app
Is there a smart way to do this?
Please refer the below posts; you would get answer for your question!
Embed activity feed of a public Facebook page without forcing user to login/allow
Get public page statuses using Facebook Graph API without Access Token
Can you get a public Facebook page's feed using Graph API without asking a user to allow?
https://developers.facebook.com/docs/graph-api/using-graph-api
I have uploaded some pics in "photostream" though the Flickr website.
Now I want to integrate Flickr in my Android app. How can I download those same pics in my device using the Flickr API? I did the "login" part for these but I don't know how to fetch my uploaded images.
flickr.people.getPhotos or flickr.people.getPublicPhotos
Return photos from the given user's photostream. Only photos visible to the calling user will be returned. This method must be authenticated; to return public photos for a user, use flickr.people.getPublicPhotos.
Note that the API docs lists this project https://code.google.com/p/flickrj-android/ which might make your life easier. In there it is the LoadPhotostreamTask.
I have folowing scenario.
My client (local tv publisher) publishes some article and embeds tweet in it. ID of embeded tweet is sent through api to android application.
On android side i have integrated Fabric/TwitterKit and by following steps on twitter developers page i managed to show tweet in my android app on (i admit) easy way (Show tweet exp).
Now i have published application to Alpha and noticed one "little" problem :-). TwitterKit was using my local twitter account to authenticate and to show tweets. If you dont have Twitter application installed or signed out of it, my show tweet functionality wont work..
This is TwitterLogin explanation for obtaining TwitterKit auth token:
"When attempting to obtain an authentication token, the Kit will use the locally installed Twitter app to offer a single sign-on experience. If the Kit is unable to access the authentication token through the Twitter app, it falls back to using a web view to finish the OAuth process.
The simplest way to authenticate a user is using TwitterLoginButton, inside your layout..."
What i want is to simply show content of tweet by given tweetID. No sending tweets, or any other action with it. Just show data from given url. Is it possible without authentication, or what should i do now, so that current implementation works without user authentication (or with some non-single-signon-inside-app authentication)
Thank you.
UPDATE 1:
I have created MyApp extends Application class, and placed code below inside onCreate method. In application tag inside AndroidManifest file, added line:
AndroidManifest.xml
android:name=".MyApp"
onCreate:
TwitterAuthConfig authConfig =
new TwitterAuthConfig(DeveloperKey.TWITTER_CONSUMER_KEY, DeveloperKey.TWITTER_CONSUMER_SECRET_KEY);
Fabric.with(this, new TwitterCore(authConfig),
new TweetUi());
It works so far, but i am not sure if this implementations is valid.
DeveloperKey.TWITTER_CONSUMER_KEY and DeveloperKey.TWITTER_CONSUMER_SECRET_KEY are static values obtained from application created at apps.twitter.com.
You need to use Application Only authentication.
That will generate a set of keys which can be used by the application. It won't be able to post messages to Twitter (because no user is associated with it) but you will be able to read Tweets.
If you build the keys into the app, your user won't have to sign in.
All the documentation is at https://dev.twitter.com/oauth/application-only
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.