For Facebook SDK 3.0:
I use the following FBRequestConnection block to share my application on my facebook friends wall with this facebookid as a parameter of the .IF method that you want to share the same on your own wall, just change
[NSString stringWithFormat:@"%@/feed",friendId]
with
@"me/feed"
-(void)postToFriendWall:(NSString*)friendId{ NSString *pictureUrl = [NSString stringWithFormat:@"http://......."]; NSMutableDictionary *postParams = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Name", @"name", @"www.mylink.com", @"link", @"Caption Text", @"caption", @"Description Text", @"description", @"Post Message", @"message", pictureUrl, @"picture", nil]; [FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/feed",friendId] parameters:postParams HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (!error) { UIAlertView *postSentAlert = [[UIAlertView alloc] initWithTitle:@"Facebook" message:NSLocalizedStringFromTable(@"kFacebookPostAlertTitle", @"ContactList", "") delegate:nil cancelButtonTitle:NSLocalizedStringFromTable(@"kOK", @"ApplicationStrings", "") otherButtonTitles:nil]; [postSentAlert show]; } }
source share