How to post to a friends Wall using Facebook Graph API for iPhone
Have you tried using,
[facebook requestWithGraphPath:@"[friend_ID]/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];
UPDATE:
Posting on friends wall will no more work with Graph API. Instead you must use FBDialog.
Facebook API: Post on friend wall
See this
-(IBAction)PostToBuddyWall
{
NSMutableDictionary *postVariablesDictionary = [[NSMutableDictionary alloc] init];
[postVariablesDictionary setObject:@"LOL" forKey:@"name"];
[postVariablesDictionary setObject:self.postTextView.text forKey:@"message"];
[objDelegate.facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed",friendId] andParams:postVariablesDictionary andHttpMethod:@"POST" andDelegate:nil];
NSLog(@"message: %@",postVariablesDictionary);
[postVariablesDictionary release];
UIAlertView *facebookAlter=[[UIAlertView alloc] initWithTitle:@"Message" message:@"Posted successfully on facebook" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil, nil];
[facebookAlter show];
[facebookAlter release];
[self dismissModalViewControllerAnimated:YES];
}
Publish message to friend's wall from iPhone app
Looks like this might be what you are after.
From the link:
"You just have to send your friend's Facebook ID as a parameter under the key "target_id".
set a parameter under the key @"target_id" on the parameters dictionary (when invoking dialog:andParams:andDelegate: on the Facebook object).
Here you have a sample post using the new sdk (the one that uses graph api):
NSMutableDictionary* params = [NSMutableDictionary dictionary];
[params setObject:@"Some text" forKey:@"user_message_prompt"];
[params setObject:@"another text" forKey:@"action_links"];
[params setObject:@"Yet another text" forKey:@"attachment"];
[params setObject:@"SOME FACEBOOK ID" forKey:@"target_id"];
//At some point you need to create the following Facebook instance
[facebook dialog: @"stream.publish"
andParams: params
andDelegate: self];
iPhone App Send Facebook Message or Post to Friend's Walls
For posting on Friend's wall, you can use FB's graph api. Here you go with the minimal code snippet for publishing something on friend's wall:
NSMutableDictionary* params = [NSMutableDictionary dictionary];
[params setObject:@"Some text" forKey:@"user_message_prompt"];
[params setObject:@"another text" forKey:@"action_links"];
[params setObject:@"Yet another text" forKey:@"attachment"];
[params setObject:@"SOME FACEBOOK ID" forKey:@"target_id"];
//At some point you need to create the following Facebook instance
[facebook dialog: @"stream.publish" andParams: params andDelegate: self];
iPhone - Facebook post to a friend's wall
There's a similar related thread here about posting to facebook wall (unfortunately that was the case for the user him/herself only). I was thinking that you might be able to modify the graph path to use a friend's user_id instead of your own, in the fragment:-
...requestWithGraphPath:@"[user_id]/feed"...
Need to first test it out to verify this, but this seems like an option to me.
Related Topics
Share Datas Between Two Apps with iOS 8 App Groups (Using Nsuserdefaults)
Will Push Notification Still Work After Ownership Transfer in Itunesconnect
What Is the Swift Preprocessor Equivalent to iOS Version Check Comparison
Apple Watch - Only Getting Data If App on Phone Is Active
Finding Distance Between Cllocationcoordinate2D Points
iOS Swift 3:Convert "Yyyy-Mm-Dd'T'Hh:Mm:Ssz" Format String to Date Object
Com.Facebook.Sdk Error 2 on iOS
iOS Client Certificates and Mobile Device Management
Using Sysctlbyname() from Swift
Uitableviewcellaccessorycheckmark and Autolayout Constraints
How to Read Incoming Sms by Using Application in iOS
Programmatically Highlight Uibarbuttonitem
Optional Binding Succeeds If It Shouldn'T
Can't Scale Device Window in iOS Simulator