0

次のコードを使用して、友人の Facebook ウォールにメッセージを投稿しています。このコードは、ログインしているユーザーのウォールにメッセージを投稿しますが、友人のウォールには投稿しません。

また、「to」の値、つまり友人の facebook ID (116623456) と App_id も指定していますが、同じ問題が解決しません。

これについて良い方向性を提供してください。

- (void)facebookViewControllerDoneWasPressed:(id)sender   
 {
       NSLog(@"DonePressed Called");
       NSString* fid;
       NSString* fbUserName;

       NSString *message = [NSString stringWithFormat:@"You have been selected as a       health coach(Multiple Users1), You will be receiving daily and weekly reports from here on!!!!"];


       NSLog(@"Before For");

//   NSString *SelectedFriends = nil;
for (id<FBGraphUser> user in _friendPickerController.selection)
{

    fid = user.id;
    fbUserName = user.name;


     NSLog(@"User Name =%@, USer id =%@",fbUserName, fid);


}
NSLog(@"After For");
NSLog(@"%@",fid);

NSMutableDictionary *params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
@"4444444444444444",@"app_id",
fid,@"to",
nil];
// Invoke the dialog


[FBWebDialogs presentFeedDialogModallyWithSession:nil
                                       parameters:params
                                          handler:
 ^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
     if (error) {
         // Error launching the dialog or publishing a story.
         NSLog(@"Error publishing story.");
     } else {
         if (result == FBWebDialogResultDialogNotCompleted) {
             // User clicked the "x" icon
             NSLog(@"User canceled story publishing.");
         } else {
             // Handle the publish feed callback
             NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
             if (![urlParams valueForKey:@"post_id"]) {
                 // User clicked the Cancel button
                 NSLog(@"User canceled story publishing.");
             } else {
                 // User clicked the Share button
                // Show the result in an alert
                [[[UIAlertView alloc] initWithTitle:@"Result"
                                             message:@"Message Posted Successfully"
                                            delegate:self
                                   cancelButtonTitle:@"OK!"
                                   otherButtonTitles:nil]
                  show];


             }
         }
     }
 }];

}

4

1 に答える 1