0

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

4

4 に答える 4

1

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];
于 2012-08-27T08:33:38.270 に答える
1

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).

于 2012-09-01T04:56:53.263 に答える
0

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];

     }
}
于 2013-01-31T09:37:04.230 に答える
0
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

于 2012-08-27T08:42:31.697 に答える