Reputation: 4543
I have seen this question asked before but none of the solutions work for me.
I am trying to post a photo to a users wall (as well as it saving to the photo album of the app)
I am using iOS 6 but I can not use the native popover code.
I am able to post a photo just fine, and I can post a normal message just fine (so permissions seem to be fine) but I can not upload a photo WITH a message/caption.
I am using the iOS Facebook SDK.
Here is one (Of MANY ways I have tried)
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[UIImage imageNamed:@"bla"], @"source",
@"caption desc", @"message",
@"caption", @"caption",
nil];
FBRequest *request = [FBRequest requestWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST"];
FBRequestConnection *connection = [[[FBRequestConnection alloc] init] autorelease];
[connection addRequest:request completionHandler:^(FBRequestConnection *connection, id result, NSError *error){
isProcessingFacebookSharing = NO;
NSLog(@"Facebook Post Result: %@", result);
if (error != nil)
{
NSLog(@"Facebook Posting Error: %@", [error localizedDescription]);
}
if (!isProcessingTwitterSharing)
{
dispatch_async(dispatch_get_main_queue(), ^(void){
[self cancelButtonPressed:nil];
});
}
}];
[connection start];
This posts my photo just fine but does not add a caption/message/description (or whatever you want to call it)
I have seen people who have said to try the following endpoints, which I have tried and get the same result.
me/photo
feed
me/feed
There are others I have tried but those are all that I am remembering right now.
Anyone know what I am doing wrong?
Upvotes: 0
Views: 1133
Reputation: 4543
Turns out that the issue wasnt with the code above but instead something going wrong with Xcode.
I was having an issue with Xcode where I couldnt do an Cmd-Z (Undo) and my breakpoints were firing in odd places.
Finally closed Xcode, Deleted the app out of the Simulator, and deleted the apps Derived Data.
When I opened Xcode again all of my changes were gone. File looked like nothing had been touched.
Changed my code back to the above and it worked.
So FYI for anyone in the future, the above does work!
Upvotes: 0