[Solved] How to post text on friends wall using latest facebook sdk in IOS


You can post on friends wall by using FBWebDialogs class of Facebook SDK. For that you need friends facebook id in parameters in dictionary as below

    NSMutableDictionary *parmaDic = [NSMutableDictionary dictionaryWithCapacity:5];
    [parmaDic setObject:link forKey:@"link"];            // if you want send picture
    [parmaDic setObject:@"NAME" forKey:@"name"];         // if you want to display name
    [parmaDic setObject:message forKey:@"description"];  // if you want to display  description
    [parmaDic setObject:@"FRIEND_FACEBOOK_ID" forKey:@"to"];
    [parmaDic setObject:@"LOGO_URL" forKey:@"picture"];  // if you want to send App logo

    [FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:parmaDic handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error)  {
        if (error) {

           // Case A: Error launching the dialog or sending request.
           // NSLog(@"Error sending request.");

        } else {

                if (result == FBWebDialogResultDialogNotCompleted) {

                    // Case B: User clicked the "x" icon
                    //    NSLog(@"User canceled request.");

                } else {    

                        //   NSLog(@"Successfully Invited.");

                  }
               }
         }];

4

solved How to post text on friends wall using latest facebook sdk in IOS