How to use Facebook Photos in an iPhone App? - iphone

I have a client who wants to use their Facebook photos in an iPhone app. We want to embed their account into the app so that when people download the app, they see the client's Facebook photos. The user should not need to login or connect to Facebook.
This is different than the standard "connect to facebook so we can access you data" - we have no need to access the users data.
Do I need to create a Facebook App, connect the client's Facebook account to the Facebook app, then use that to get the photo data ?
Ok, here is what I found
My business page is http://www.facebook.com/pages/Feltpad-Web-Mobile/128861547181352
That number at the end (128861547181352) is the business' "Facebook Graph ID"
Then use the Business Graph ID and go to http://graph.facebook.com/128861547181352/albums and you will see a list of all of the Photo Albums associated with the business' page. There is only one album, so that is all the info you get. The first valuable line on that page says "id": "133208113413362" - this is the Facebook Graph ID for the album.
Then use the Album's Graph ID and go to http://graph.facebook.com/133208113413362/photos - this will give you a JSON file with all the data you need for all the photos in the album.
You can also use ?limit=25 and ?offset=50 or both ?limit=25&offset=50 to page through the results.

This should be easy. Facebook gives a public URL for albums that are public to be viewed by the Internet without necessity of logging in. You can see this URL al the bottom of the album page that you may want to share.
It looks like this:
Share this album with anyone by sending them this public link:
http://www.facebook.com/album.php?aid=[ALBUM_ID]&id=[USER_ID]&l=[SOME_PARAM]
(quoted from a public album)
you can easily leach data and extract images from there.
However it is more sane to create a Facebook app (takes hardy a minute) and use Facebook graph-API to make REST calls to retrieve all the data about albums and photos within them in well formatted JSON that will be far easier to handle the HTML. Once you have Facebook App in place, you may use it to fetch all the FB data but it violates both of your requirements (1)Not using Facebook app, and (2) user don't have to sign-in.
But it may worth looking at
http://developers.facebook.com/docs/api
http://developers.facebook.com/docs/reference/api/album
Well, there is some trick. If you go to the API page(http://developers.facebook.com/docs/api). Copy the URL given for Coca-Cola album (https://graph.facebook.com/99394368305) and make a request with photos REST command like https://graph.facebook.com/99394368305/photos you can access all the details of all the photos in the album in JSON format. I could not get it work for my personal public album though.

Related

How to get OTHER users' photos and albums with Facebook Graph API

Scenario: logged with my Facebook account and using a browser, I'm able to see some photos and albums of some users which aren't friends of mine (with a privacy setting of public or similar) and quite all their past profile photos.
For example the URL
https://www.facebook.com/<userid>/photos_all shows those photos.
I want to replicate behaviour with Graph API but GETting
https://graph.facebook.com/<userid>/photos?access_token=...
Gives me an empty data array.
Same scenario using tagged or albums instead of photos
I've tried to use site scraping but FB website uses AJAX to populate gridview of photos, so It's very difficult.
On Graph API Explorer I've requested and use an access token with all permissions and also a debug access token but I'm still unable to get other users' photos.
It's possibile to get photos of users which aren't in friend list with Facebook Graph API? Am I missing something?
For privacy reasons, it´s not possible to get the photos of OTHER users with the API. Even for the authorized user, you need the user_photos permission.
Scraping is not allowed btw: https://www.facebook.com/apps/site_scraping_tos_terms.php

Can you use Facebook Graph API to post a photo to a brand account as well as user account?

I am working on a project where a photo is taken and the user can share their photo on Facebook. We would use oAuth and the FB Graph API to post the photo and caption to the users' timeline. The client just made a request to also post it to their (the client's) photo album as well. So when the user submits a photo, it would post to the user's timeline as well as the client's timeline/album. Is this double post (to two different accounts) possible? Wouldn't that require that the client be logged in via oAuth as well? Also, are there any FB legal/regulation issues with this so long as the application has a disclaimer that it will be posted to two different places?
The entry for the user is a new photo to the apps album for that user. me/photos
However the entry that goes to your clients page... I don't think people can do id/photos of others or pages. (it's worth a shot)
You'll have to stick to id/feed and perhaps include a link to an image host.

How to display my photo albums and photos that are in FB on my own website

I would like to display my photo albums and photos that are in FB on my own website. However everything I have tried requires an access token that I seem to only get if I login to FB. I don't want visitors to my site to have to login to FB to see my photos.
Is there a way to get this data and not require a login? I want to pull data from my own FB account. Or is there a different way to authenticate my access behind the scenes so visitors don't have to login, to see my photos?
Facebook has recently launched a way to share the album with public without having to Signin. Every album will have link below this key word Share this album with anyone by sending them this public link. Take a look at this HOW TO for more information.
EDIT: However, for embedding refer this SO which explains how to grant permanent access to your photo albums
Another option is using 8 photo restricted Facebook Photo Badge
Showzey seems to be working on liberating your photos and provides widgets.
Facebook has a badges page that has different options for embedding Facebook content onto your site. The photo badge should fit your criteria.
May be this method could help you guys.
You can do it through a public fan page or a business page.
I put this script together a while back: http://roughgiraffed.com/FBalbum/. Working on a more legit version - will post when complete.
You can combine galleria (open source javascript image gallery framework) with a plug-in to integrate with facebook.
You can find the links bellow:
http://galleria.io/
http://www.alexanderinteractive.com/blog/2012/03/display-facebook-photos-on-your-website-with-galleria/
I'm using this very nice plugin for Joomla. Take a look.

Reaching users of facebook app

I have a web app that is connected to facebook graph, and thus have a corresponding facebook app. I'm looking for a means of communicating with the users of my app through their facebook feed.
So far I've asked the users to like the facebook application profile page for my app, so that when I post news on that wall, the users get it. This causes some confusion since the application profile page is a bit of a peripheral component in the webapp-facebook relationship.
Ideally I would be able to post on facebook either as the app, so that I reach all the registered users, or as the app url (www.myapp.url) so that users who like that url will get the posts. Alternatively somehow link the application profile page and the url/app, so that likers of the url or users of the app get the profile page posts.
Note that I'm not looking to post to users walls (just their feeds) and I'd prefer to post manually, using facebooks interface for posting.
The only ways you can publish into a user's news feed is to use a Facebook Page or a Facebook Open Graph Object. So, you did right by asking users to like your Facebook Application Page. If you've also got a webpage that people like, you can turn that webpage into an Open Graph object by adding an fb:app_id or fb:admins meta tag to the head of the page. Doing this grants you access to publish to your fans' news feeds, and you get access to a Facebook page-like interface (for administration purposes only). You can publish to the user's feed using this feed publisher (just like you would do if your Graph object were any other Facebook Page).
To get to the admin page you just have to make sure your Facebook User ID is in the fb:admins meta tag. Once it is, visit a like button social widget for that object, and you'll get the a link that lets you go to the admin page for the object.
I hope that's clear. You should probably give the Open Graph Protocol Documentation a good read.

Facebook Connect and Photo Albums

I am currently developing a site for models/actors, and at this point I am just trying to ascertain what I can and can't do with Facebook Connect (I have virtually no experience in using Facebook Connect or FQL).
Basically there is going to be a facility whereby users will be able to upload their pictures. I want to know is it possible to use Facebook Connect to get the user's photo albums, in order to save the user from re-uploading all the photo's that are already on FB?
If so, do I/should I LINK to these photos, or FETCH them from Facebook and save a copy on my server?
EDIT: Just to clarify, this is what I want to do:
User will register on my site and agree to associate their Facebook ID with my site.
I then want to present the user with a list of all their albums that are on Facebook, the user can then select which albums they want to display on my site.
(optional) The user can select which specific photos in each album they want to display on my site.
Is this possible to do at all?
You can upload photos using the API. Check out this: http://developers.facebook.com/docs/reference/api/photo
If it were me, I would just upload the photo to Facebook and save the URL of the image rather than store it on my own server. You could do either one, but I don't see the sense is storing the image twice. The one issue could be if you wanted your photo at a higher quality than Facebook allows, but their quality is pretty high.