【发布时间】:2012-04-27 16:43:04
【问题描述】:
我正在开发应用程序,在该应用程序中,我必须通过我的帐户向我的朋友墙发布问候。
那么我该如何执行呢?如果有人有想法请帮助我。
提前致谢。
【问题讨论】:
标签: iphone objective-c ipad
我正在开发应用程序,在该应用程序中,我必须通过我的帐户向我的朋友墙发布问候。
那么我该如何执行呢?如果有人有想法请帮助我。
提前致谢。
【问题讨论】:
标签: iphone objective-c ipad
试试这个
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/
【讨论】:
首先使用字典,在其中添加您想在朋友的墙上发布的数据:-
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];
这就是将数据发布在朋友的墙上的方式。 希望对你有帮助谢谢:)
【讨论】: