I can't seem to work out how to tag users in a Facebook photo upload.
The documentation seems to suggest that you use an array, but the following code doesn't parse correctly (causes an application crash)
- (void)uploadImage:(UIImage *)img
withTags:(NSArray *)tags
{
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"msgstring", @"message",
img, @"picture",
nil];
if (tags) {
[params setObject:tags
forKey:@"tags"];
}
self.requestType = FBAssistantRequestImageUpload;
[self.facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
}
It works fine without the tags. The array at the moment contains a single string with the identifier of the friend I wish to tag.
I assume I'm adding the tags incorrectly. I was hoping to avoid having to use the three-step method outlined here: Tag Friends in Facebook Photo Upload, as I believe that requires photos permission, which just posting the photo doesn't need.