0

我正在使用此包装器尝试将带有标题的图像发布到用户的墙上:

我已经使用以下代码将其发布到相册,但我不知道如何将其发布到用户的墙上。

UIImage *img = [logo getMyLogoImage];        
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"This is a caption! Do you know this logo?",@"message",img,@"picture",nil];
[[SPFacebookClient_MyApp sharedClient] requestWithParams:params completionHandler:^(BOOL success, id result, NSError *error){}];

我可以看到使用常规的 Facebook sdk,我可以调用它来发布到墙上:

[FBRequestConnection startWithGraphPath:@"me/Photos"
          parameters:params
          HTTPMethod:@"POST"
          completionHandler:^(FBRequestConnection *connection, id result, NSError *error){[self showAlert:@"Photo Post" result:result error:error];}];

不过,我真的很想弄清楚如何使用包装器来实现这一点,因为它使管理会话和一般设置变得更加容易和清洁。谁能解释我必须改变或添加什么才能使这项工作?

4

1 回答 1

0

请如下更新您的代码并尝试。

UIImage *img = [logo getMyLogoImage];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"This is a caption! Do you know this logo?",@"message",img,@"picture",nil];    
[[SPExampleFacebookClient sharedClient] requestWithName:@"stream.publish" params:params method:@"POST" completionHandler:^(BOOL success, id result, NSError *error){
    NSLog(@"Error - %@", error);
}];
于 2012-12-10T12:08:09.380 回答