how to create new photo album for facebook with iPhone - ios

I'm able to push a image from my iPhone to the facebook wall successfully. But when I try to push my 2nd image the image is uploaded successfully on the wall but appears side-by-side instead of appearing as the different wall post.
This is because the images uploaded will be added to the same photo album. So is there any way to push these images to new album so that every album contains 1 image?

First make sure you have publish_stream permission to create a new album.
Then to create a new album, make a Graph API call to https://graph.facebook.com/me/albums with parameters for the access token, the album name, and the album description. If the album is created successfully the new album ID will be returned.
Then make a call to https://graph.facebook.com/NEW_ALBUM_ID/photos with the access token and other photo parameters to upload your photo to the new album.
By default, if you do not specify any album and just push photos to the me/photos endpoint your photos will end up in an album automatically created for your application.

Related

How to access photo gallery within iOS (objective c) app to pick photo while sharing

There was an answer which lets an app select photos by opening the photo gallery How To Access Camera & Camera Roll Objective-C . But I want the new photo picking feature like whatsapp where we don't need to pick the photo from the gallery but while sharing there is a camera view and a view which lets you select photos in your album from the app itself . How would I populate the list of pictures within my app?
Something like this instagram sharing option http://www.iclarified.com/images/news/51645/244140/244140.jpg
Got the Answer !
It's the new Photos framework .
Uses assets to find the contents of photos .
https://developer.apple.com/library/ios/documentation/Photos/Reference/Photos_Framework/
An instance of ALAssetsLibrary provides access to the videos and photos that are under the control of the Photos application.
The library includes those that are in the Saved Photos album, those coming from iTunes, and those that were directly imported into the device. You will use to retrieve the list of all asset groups and to save images and videos into the Saved Photos album.
ELCImagePickerController is an Example project for getting all the photos in the iPhone Photo Album.

Post image to facebook album without wallpost about it?

I'm thinking about a two step OpenGraph image upload workaround (post to album, get photo link, call OpenGraph with the image url), but I need to hide the album post from the user's wall.
If my suspections are right, I can't upload image along an OpenGraph object (thatswhy I want to work around).
So possible to hide album upload from the user's wall?
Or the original problem, possible to upload image file along OpenGraph object?

Facebook graph API can_upload doesn't always work

My application allows the user to upload photos to Facebook. Before the photo is uploaded I show the user a list of all their photo albums from Facebook. According to Facebook can_upload Determines whether the UID can upload to the album and returns true if the user owns the album, the album is not full, and the app can add photos to the album.
From trying it out I can upload to some albums where can_upload is 0 my question is how do I tell if I can upload to any given album?

Can I attach an image to an FBDialog?

I'm writing an iOS app that produces an image, and we'd like the user to be able to post that image to their Facebook wall using the standard facebook dialog.
The Facebook iOS SDK provides a dialog for posting to a user's wall, using the dialog:withParams:andDelegate: method, and you can provide the URL of a picture in the params argument. However, that's no good to me - I want to send off an image that exists only on the phone.
The SDK also provides a way to post an image to a user's wall, using the requestWithGraphPath:andParams:andHttpMethod:andDelegate: method. But that's no good to me either - I want to use the standard dialog.
Is there a way for me to send the image data with an FBDialog?
You need to do a photo upload first, with a graph call to '/me/photos' - this will be in an album that your app will have to create, not an existing one (unless your app created it).
That will return you the photo id, which you can then hit the graph again with a call to that specific id: 'https://graph.facebook.com/RETURNING_PHOTO)ID'
This will return name, picture, source, link (and a bunch of other stuff) - you can then use the picture (which is a thumbnail) in your wall post as the picture and add the URL to the source (big image) or use the link to the photo in the album (link) inside your message text.
Hope this helps,
-J

Photo posted via Facebook IOS SDK goes to wrong album

Generally, when we post a photo to Facebook using the Facebook iOS SDK, it automatically goes into a photo album named after the application. For example, if the Facebook application is called "MyApp" then the photo gets saved to the photo album 'MyApp photos'.
However, as of two days ago, an app that we are working on has started behaving oddly, with all the photos posted through it being saved to a 'DifferentApp photos' photo album.
The photo is still associated with the correct app because underneath the caption it still says 'X minutes ago via MyApp' and the MyApp link goes to MyApp. For the life of me, I can't work out how 'DifferentApp' came into the picture.
The code that posts the photo hasn't changed but for what it's worth;
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:img, #"picture",message,#"caption",nil];
[appDelegate.fbObj requestWithGraphPath:#"me/photos"andParams:params andHttpMethod:#"POST" andDelegate:self];
What has changed is that we are now forcing the Facebook SDK to authenticate via in-app webview rather than by switching to the Facebook app (see Disable Single Sign On (SSO) in Facebook IOS SDK)
A few other points to consider;
If we delete the 'DifferentApp Photos' album and then post a new photo, the photo gets saved in a another album, i.e. 'ThirdApp Photos'
We registered a whole new Facebook app and posted photos through that - the photos still go to the wrong album
Any thoughts/ ideas would be greatly appreciated.
Check the photo id which comes in the response after calling me/photos on the graph API and you might notice the same thing I did. And now, for the rest of the story :-)
I ran into the same issue with newly created Facebook apps while apps I created months ago still allowed me to upload pictures to my wall & associated photo album without any issue.
Surly the photo was getting uploaded to Facebook since a valid response was coming back with the photo's id however turns out if I append the newly uploaded photo's id to http://www.facebook.com/photo.php?fbid= the photo would show up but in an album which couldn't be deleted nor was accessible in my list of albums. (The album was named after an iOS app which used Facebook Connect, I made over a year ago)
After more hacking and whacking I decided to log into my iOS app with another Facebook account which hardly has any data. To my surprise I was able to successfully upload a picture to the app's album and see it appear on my wall.

Resources