I had a problem trying to post an image on the FB page. I am an administrator. The image is uploaded to my own account, not to my page.
Here is the code I use for this:
- (void)apiGraphUserPhotosPost:(UIImage*)img withMessage:(NSString*)message { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUInteger c; for (c = 0; c < [gFBPageArray count]; c++) { if ([[[gFBPageArray objectAtIndex:c] objectForKey:@"name"] isEqualToString:[defaults objectForKey:@"FBPostAs"]]) break; } params = [NSMutableDictionary dictionaryWithObjectsAndKeys: img, @"picture", message, @"message", [[gFBPageArray objectAtIndex:c] objectForKey:@"access_token"], @"access_token",nil]; [[self facebook] requestWithGraphPath:[NSString stringWithFormat:@"/%@/photos", [[gFBPageArray objectAtIndex:c] objectForKey:@"id"]] andParams:params andHttpMethod:@"POST" andDelegate:self]; }
[defaults objectForKey:@"FBPostAs"] contains the name of the FB page where I want to upload the image.
gFBPageArray contains a list of FB pages where I have administrator privileges.
Am I doing something wrong?
I did something similar with / Page ID / feed and / Page ID / video and it works well ...
source share