-1

我正在开发应用程序,我必须通过我的帐户向我的朋友墙贴发布问候。

那么我该如何执行呢?如果有人有想法请帮助我。

提前致谢。

4

2 回答 2

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 like.message,picture ..etc 请参阅http://developers.facebook.com/docs/reference/api/post/

于 2012-04-16T10:54:04.167 回答
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];

这就是将数据发布在朋友的墙上的方式。希望对您有所帮助谢谢:)

于 2012-04-16T11:03:13.693 回答