尝试在FB页面上发布图片时遇到问题,我是管理员。图片上传到我自己的帐户而不是我的页面。
这是我用来执行此操作的代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - (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]; } |
gFBPageArray包含我具有管理员权限的FB页面列表。
我做错什么了吗?
我对/ PageID / feed和/ PageID / videos做了类似的操作,效果很好...
您可以在以下位置找到此问题的答案:图片在错误的地方贴到facebook上结束
如果需要,我可以在此处添加(复制/粘贴)代码的更多详细信息。