Post to friends wall using Facebook SDK 3.0 for iOS

I want to post to my friends wall using facebook sdk 3.0. So please let someone offer me.

I also tried this

But it did not work for me

0
source share
4 answers

I think this code may work.

NSMutableDictionary *params; params = [NSMutableDictionary dictionaryWithObjectsAndKeys: userID, @"to", msg,@"message", theUrl, @"picture", appLink, @"link", nil]; [facebook_ dialog:@"feed" andParams:params andDelegate:self]; 
+1
source

https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/

You need to import obsolete headers into your project. They are located in /FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders. After importing all these files, you can create a facebook object and do what the other answers say. The FB 3.0 SDK does not work for any of the old functions that used FBDialog (sending application requests, posting on the wall, etc.).

+1
source
 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 do not need to authenticate with facebook. If you are not a username than the first login screen, not the Open Sharing dialog box. Also see

0
source

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]; } } 
0
source

Source: https://habr.com/ru/post/1433379/


All Articles