我正在使用 facebook SDK 3.13 使用 fbwebdialogs 在用户的 friend 墙上发帖。当我为此对话框设置参数时,它不会在对话框中显示它们。
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) {
}
}];
}
它不识别这些链接并产生错误。如果有人在用户的 friend 墙上发帖,请通知我。
Best Answer-推荐答案 strong>
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];
}
}}];
关于ios - 如何使用 facebook sdk 在 friend 的墙上发帖?,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/22828476/
|