早上好,
我有这个代码在我的画廊中发布照片:
- (IBAction)postPhotoClick:(UIButton *)sender {
// Just use the icon image from the application itself. A real app would have a more
// useful way to get an image.
UIImage *img = [UIImage imageNamed:@"Icon-72@2x.png"];
// if it is available to us, we will post using the native dialog
BOOL displayedNativeDialog = [FBNativeDialogs presentShareDialogModallyFrom:self
initialText:nil
image:img
url:nil
handler:nil];
if (!displayedNativeDialog) {
[self performPublishAction:^{
[FBRequestConnection startForUploadPhoto:img
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:@"Photo Post" result:result error:error];
self.buttonPostPhoto.enabled = YES;
}];
self.buttonPostPhoto.enabled = NO;
//proceedToPost();
}];
}
}
但是,我需要在朋友的画廊中发布照片。这是可能的?我怎么能这样做?
答案 0 :(得分:0)
我通过使用图表API找到了解决方案。
完成适当的登录后:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.originalImage, @"source",
@"MessageText", @"message",
nil];
[self.facebook requestWithGraphPath:@"user_name/photos/"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
此代码适用于在我的albuns中发布图像。现在我需要在朋友的相册上发布照片。