Im developoing an app for the iPhone where users can chat using their facebook account info.
in this case: the facebook username & profile image. my question is How can I share the users profile picture in the chat box so that people can see each others avatars?
the pictures must be online somewhere? how to get to that url?
I should do somthing like this when the send button is tapped:
get the username, get the msg, get the the avatar url.
send the info to the chat server.
alt text http://img98.imageshack.us/img98/5103/screenshotrci.png
first get the album name by using FBconnect.photos.getAlbum and pass UID. it will return an array with all album info .then find the album name " profile pictures" and their album id.
after that use this album id to get the profile photo .
using this api FBConnect.photos.get and pass album id as params
this might be a little late, but all you need to do is put "pic_square" (a 50x50 image) into the fql query that you use for getting the name
NSString* fql = [NSString stringWithFormat:#"select uid, name, pic_square from user where uid == %lld", self.usersession.uid];
and that's it, it'll return a string with the URL of the image you want.
Related
I am using facebook friend picker dialog and on the result, I am getting name and Profile Pic only.
How can I get all fields like Email, Bday, Phone no.. etc.
I want to have a link between the currently used profile picture and the original source in the profile album.
I'm getting the profile picture with:
/me/picture?redirect=false
Which will return url, width & height but unfortunately no id. (https://developers.facebook.com/docs/graph-api/reference/profile-picture-source/)
I'm getting all the albums with:
/me/albums?fields=id,type
Then I'm iterating through all the albums to find the one with the type=='profile' and then retrieve all the photos of this album:
/{albumId}/photos?fields=width,height,id,images
How can I identify the photo used as the profile picture?
Since we have no id returned from the /me/picture endpoint I don't see a way to make the link between the two objects.
Also, I'm not sure that we can rely on CDN urls to parse them and try to find the profile picture id.
I have a sample application that uploads photos to a user's FB account. Of course, FB creates an album with the name of the app and loads the photos in that album.
If the user changes the name of the album, then FB still uploads photos to the same album (although the album has been renamed).
How does FB know which album belongs to my application? There are no obvious signs of linkage between my appid and the album ids / links that FB creates for the album.
Thanks in advance.
SS
There's likely an association on the backend between the AppID and the AlbumID.
There's no simple way to know your app albumID.
Three suggestions for you:
Allow the user to choose the album to upload the photo to. You can do this by uploading to albumid/photos instead of me/photos.
If you want to know your album, once you have uploaded one photo, you can use the returned ID along with FQL to query the photo table. This works independently of album and will let you query on object_id and return the album object id. e.g., SELECT album_object_id from photo where object_id = '(yourobjectid)' Store this, it won't change.
Upload a tiny test photo and use the method from 2 above. This will let you know your current album id. Then delete the tiny test photo.
Hope this helps.
I am able to grab album name and photos uploaded by the user using the graph api.
When I use "https://graph.facebook.com/me/photos?access_token=".$access_token", I get all the tagged photos of the user. Is there a way to get the name of the album of a photo, which has not been uploaded by the user but by his friend?
Thanks
I don't think you can get that directly, but using the "link" attribute you can quickly suss it out, as seen in this example:
"link": "http://www.facebook.com/photo.php?fbid=10150154222339657&set=a.358879884656.199726.249427954656&type=1"
That set parameter and fbid tell you much more about the photo.
You can view more details about the photo by going to the page for it. It will tell you the position in the album, though it still won't have the album:
http://graph.facebook.com/10150154222339657
You can however determine the album id from the set parameter, the album id is the between the a. and the second ., so in this example the album id is 358879884656
So, the album info would be available at:
http://graph.facebook.com/358879884656
Now when the user input his personal profile url to a textbox, such as http://www.facebook.com/Google.
The form immediately show the Google logo(it's the Google's facebook paeg's logo).
If I know the page id,I can show the Google logo in this way:
http://graph.facebook.com/[USER_ID]/picture
But how to know the user id with any api?
You can get the user id by parsing the url and then going to https://graph.facebook.com/Google and parsing the json response. You can also parse the url to get the profile photo: https://graph.facebook.com/Google/picture