[英]How to post on friend's wall using facebook sdk?
我正在使用Facebook SDK 3.13通过fbwebdialogs在用户的朋友墙上发帖。 当我为此对话框设置参数时,不会在对话框上显示它们。
NSMutableDictionary *params=[NSMutableDictionary new];
FBSession *ses=[FBSession activeSession];
[params setValue:@"hello" forKey:@"caption"];
[params setValue:@"hello" forKey:@"decription"];
[params setValue:@"whats" forKey:@"name"];
[params setValue:@"http://i.imgur.com/g3Qc1HN.png" forKey:@"picture"];
[params setValue:@"http://www.dsvv.org" forKey:@"link"];
[FBWebDialogs presentFeedDialogModallyWithSession:ses parameters:params handler:^(FBWebDialogResult result,NSURL *url,NSError *error){
if (error) {
}
}];
}
它不会识别这些链接并产生错误。 如果有人张贴在用户的朋友墙上,请将此事通知我。
str_link = @"www.google.com";
NSString *str_img = [NSString stringWithFormat:@"%@uploads/%@-5.jpg",app.Main_url,[Data_Dict objectForKey:@"deal_id"]];
//NSLog(@"%@",str_img);
NSDictionary *params = @{
@"name" : str_name,
@"caption" : @"",
@"description" : @"",
@"picture" : str_img,
@"link" : str_link,
@"to":str_id,
};
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
NSLog(@"Error publishing story.");
[self.indicator stopAnimating];
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
NSLog(@"User canceled story publishing.");
[self.indicator stopAnimating];
} else {
NSLog(@"Story published.");
[self.indicator stopAnimating];
}
}}];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.