使用FBWebdialogs发布给朋友墙

我使用下面的代码在Facebook发布 ,在Params词典中input所有必需的细节,并添加到FBWebDialogs ,但post不显示在朋友墙上。

NSDictionary *params = @{ @"name" :[NSString stringWithFormat:@"%@",[Data_Dict objectForKey:@"name"]], @"caption" : @"", @"description" :[Data_Dict objectForKey:@"desc_title"], @"picture" : str_link, @"link" : @"", }; [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."); } else { //NSLog(@"Story published."); } }}]; } }]; 

期待解决这个问题的想法。

 [FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session,FBSessionState state, NSError *error) { if (error) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } else if(session.isOpen) { //NSLog(@"%@",Data_Dict); NSString *str_link = [NSString stringWithFormat:@"%@uploads/%@-5.jpg",app.Main_url,[Data_Dict objectForKey:@"deal_id"]]; //NSLog(@"%@",str_link); NSDictionary *params = @{ @"name" :[NSString stringWithFormat:@"%@",[Data_Dict objectForKey:@"name"]], @"caption" : @"", @"description" :[Data_Dict objectForKey:@"desc_title"], @"picture" : str_link, @"link" : @"", }; // 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]; } }}]; } }]; [self.indicator stopAnimating]; return;