Iphone 如何发布图像+;关于friend'的文本;长城
我正试图在朋友的墙上贴一张图片和一条文字。我不应该使用该对话框,我使用stream.publish直接发布。 我可以成功地将它发布到我自己的墙上(登录用户),但我需要找到一种方法在朋友的墙上发布 这是我的代码,我需要有人帮我添加几行代码张贴到朋友的墙上Iphone 如何发布图像+;关于friend'的文本;长城,iphone,ios,facebook,ios4,facebook-graph-api,Iphone,Ios,Facebook,Ios4,Facebook Graph Api,我正试图在朋友的墙上贴一张图片和一条文字。我不应该使用该对话框,我使用stream.publish直接发布。 我可以成功地将它发布到我自己的墙上(登录用户),但我需要找到一种方法在朋友的墙上发布 这是我的代码,我需要有人帮我添加几行代码张贴到朋友的墙上 /* Friends URL To whom's wall I need to post. **I need to figure out how to use friendURL in my code. So that post goes
/*
Friends URL To whom's wall I need to post.
**I need to figure out how to use friendURL in my code.
So that post goes to my friend's wall.
Below code is posting to my own wall.**
*/
NSString *friendURL = [NSString stringWithFormat:
@"http://www.facebook.com/profile.php?id=%@",
marriedFriend.userID];
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 by Rahul...", @"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];
[facebookRef requestWithMethodName:@"stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self];
看起来您正在使用旧的API。使用较新的Graph API,您可以执行以下操作:
// replace PROFILE_ID with your friend's ID
[facebookRef requestWithGraphPath:@"PROFILE_ID/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];
现在我面临另一个问题。你能告诉我怎样才能将提要发布给多个朋友吗。当我使用facebookref变量的单个实例时。?发出多个请求。我在文档中没有看到任何发布到多个提要的方法。