发布消息在朋友Facebook Wall post

时间:2012-04-16 10:46:45

标签: iphone objective-c ipad

我正在处理应用程序,我必须通过我的帐户向我的朋友发布问候语。

那么我该怎么做呢?如果有人有想法请帮助我。

先谢谢。

2 个答案:

答案 0 :(得分:2)

试试这个

 NSMutableDictionary *parmaDic = [NSMutableDictionary dictionaryWithCapacity:4];
[parmaDic setObject:[NSString stringWithFormat:@"hello world"] forKey:@"message"]; // if you want send message  
[parmaDic setObject:@"http://icon.png" forKey:@"picture"];  // if you want send picture    
[parmaDic setObject:@"Create post" forKey:@"name"];         // if you want send name    
[parmaDic setObject:@"Write description." forKey:@"description"]; // if you want  description

[_facebook requestWithGraphPath:[NSString stringWithFormat:@"/%@/feed",facebook_user_id] 
                      andParams:parmaDic 
                  andHttpMethod:@"POST"
                    andDelegate:self];

我使用key.message,picture ..等等,请参阅http://developers.facebook.com/docs/reference/api/post/

答案 1 :(得分:1)

首先按字典添加您要在朋友的墙上发布的数据: -

NSMutableDictionary  *postVariablesDictionary = [[NSMutableDictionary alloc] init];
//posting the text written in the textView   
[postVariablesDictionary setObject:self.TextView.text forKey:@"message"];

[objDelegate.facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed",friendId] andParams:postVariablesDictionary andHttpMethod:@"POST" andDelegate:nil];

这是如何将数据发布在朋友的墙上的。 希望它有所帮助谢谢:)