是否可以在用户朋友的墙上发布内容,而无需先让所有朋友(所以你可以获得好友ID)?
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
答案 0 :(得分:3)
您可以通过向me/friends
发出请求来获取登录用户的朋友
然后你可以创建一个显示朋友列表的ui元素,用户可以选择他想与之分享的元素。
然后,在用户选择后,您只需在FRIEND_ID/feed
publish_stream
(Feed connection of the User object)发布POST即可在其墙上发帖。
您需要拥有Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends
权限才能:{{1}}(http://developers.facebook.com/docs/authentication/permissions/)
答案 1 :(得分:3)
见这个
-(IBAction)PostToBuddyWall
{
NSMutableDictionary *postVariablesDictionary = [[NSMutableDictionary alloc] init];
[postVariablesDictionary setObject:@"LOL" forKey:@"name"];
[postVariablesDictionary setObject:self.postTextView.text forKey:@"message"];
[objDelegate.facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed",friendId] andParams:postVariablesDictionary andHttpMethod:@"POST" andDelegate:nil];
NSLog(@"message: %@",postVariablesDictionary);
[postVariablesDictionary release];
UIAlertView *facebookAlter=[[UIAlertView alloc] initWithTitle:@"Message" message:@"Posted successfully on facebook" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil, nil];
[facebookAlter show];
[facebookAlter release];
[self dismissModalViewControllerAnimated:YES];
}