如何使用 iPhone 版 Facebook Graph API 发布到朋友墙上 [英] How to post to a friends Wall using Facebook Graph API for iPhone
本文介绍了如何使用 iPhone 版 Facebook Graph API 发布到朋友墙上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在用户的朋友墙上张贴一些东西.
I want to post something in the users friends wall.
我用这个发到用户墙
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",nil];
[facebook dialog:@"feed"
andParams:params
andDelegate:self];
但是我需要在我的朋友墙上发帖.我该怎么做
But i need to post in my friends wall. how can i do this
在这个帖子中,他们有提到了 targetId,我需要做些什么吗.
In this post they have mentioned about targetId do i have to do something with that.
推荐答案
有没有试过使用,
[facebook requestWithGraphPath:@"[friend_ID]/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];
更新:
在朋友墙上发帖将不再适用于 Graph API.相反,您必须使用 FBDialog.
Posting on friends wall will no more work with Graph API. Instead you must use FBDialog.
这篇关于如何使用 iPhone 版 Facebook Graph API 发布到朋友墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文