I want to post a message on my friends wall using facebook sdk 3.0. So please can any one suggest me.
I have also tried this
But its not worked for me
I think this code maybe work.
NSMutableDictionary *params;
params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
userID, @"to",
msg,@"message",
theUrl, @"picture",
appLink, @"link",
nil];
[facebook_ dialog:@"feed"
andParams:params
andDelegate:self];
https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/
You need to import the deprecated headers into your project. They are located in Documents/FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders. Once you import all these files, you can create a facebook object and do what the other answers are saying. FB 3.0 SDK does not work for any of the old features that used FBDialog (sending app requests, posting to your wall, etc).
Facebook SDK 3.0の場合:
次のFBRequestConnectionブロックを使用して、Facebookの友達の壁にあるアプリをメソッドパラメーターとして指定されたfacebookidで共有しています。自分の壁で同じものを共有したい場合は、
[NSString stringWithFormat:@"%@/feed",friendId]
と
@"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];
}
}
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"facebook key", @"app_id",
@"http://developers.facebook.com/docs/reference/dialogs/", @"link",
@"image link", @"picture",
@" ", @"description",
@"", @"name",
@" ", @"caption",
nil];
[_facebook dialog:@"feed" andParams:params andDelegate:self];
[_facebook logout];
you no need to facebook authentication.if you are not login than first show login screen and than show share dialog. Also refer