Api Facebook iphone,可能发布到朋友的墙上 [英] Api Facebook iphone , possible to post to a friend's wall
问题描述
我想知道是否可以使用iPhone Facebook API发贴到朋友的墙上。
我已经链接说明如何在用户的墙上发布,但不在firend的墙上
这里是链接:
I want to know if it is possible to post to a friend's wall using the iPhone Facebook api. I have already links explaining how to post on user'wall but not on firend's wall here are the links :
http://www.raywenderlich.com/tag/facebook
推荐答案
你只需要将你朋友的Facebook ID作为参数,在key_id下面。
You just have to send your friend's Facebook ID as a parameter under the key "target_id".
OLD SDK:set FBStream对话框的targetId属性。
OLD SDK: set the FBStream dialog's targetId property.
新SDK:在参数字典上键入@target_id下的参数(当调用对话框:andParams:andDelegate:在Facebook上对象)。
NEW SDK: set a parameter under the key @"target_id" on the parameters dictionary (when invoking dialog:andParams:andDelegate: on the Facebook object).
这里你有一个使用新的sdk(使用图形API的一个)的示例帖子:
Here you have a sample post using the new sdk (the one that uses graph api):
NSMutableDictionary* params = [NSMutableDictionary dictionary];
[params setObject:@"Some text" forKey:@"user_message_prompt"];
[params setObject:@"another text" forKey:@"action_links"];
[params setObject:@"Yet another text" forKey:@"attachment"];
[params setObject:@"SOME FACEBOOK ID" forKey:@"target_id"];
//At some point you need to create the following Facebook instance
[facebook dialog: @"stream.publish"
andParams: params
andDelegate: self];
我没有实际测试过这个代码,但是这是一个非常直接的事情,一旦你已经在墙上贴了一条消息。
I haven't actually tested this code, but this is a pretty straight-forward thing to once you have already posted a message to your wall.
希望这有帮助。干杯!
这篇关于Api Facebook iphone,可能发布到朋友的墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!