I am trying to implement Facebook Connect into my program. More specifically I am trying to post a native UIImage to the user’s Photos. I had a previous program that successfully implemented this. The user would upload the photo, then go to their Facebook page and accept the pending album. All photos thereafter would automatically load to the album. My problem is that this no longer works. When a photo is uploaded, there is no “pending album” anymore. (It does not work with my old program or the new one I am trying to implement.) Is there something that changed that I do not know about? Here is the code that I call after a valid session is established:
params = [NSMutableDictionary dictionaryWithObjectsAndKeys: img, @"picture",nil];
[facebook requestWithMethodName:@"photos.upload" andParams:params andHttpMethod:@"POST" andDelegate:self];
I also tried to implement it with the graphAPI as follows:
[facebook requestWithGraphPath:@"me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];
and this does not work either. I was able to post on my old app until yesterday, but when I deleted the album that the app had originally created, the pictures stopped appearing on Facebook. Posting plain text and links to the wall works fine, but I cannot get the photos to post. Can anyone help me? Thank you in advance.
I’m new to the fb API, but I do have one working app. The
requestWithGraphPathmethod is non-blocking – meaning it will complete before the photo is actually uploaded. You’ll know when the photo is finished uploading by implementing the following in yourFBRequestDelegate:(the upload request failed, during which you can inspect the NSError for the details as to why), or
meaning it was successful.
Try
NSLog(...)-ing these two callbacks to see what is going on with your upload. If you’re encountering a permissions or connectivity issue, you’ll see it in theNSError.Hope this helps,
Scott Heaberlin