iPhone应用程序发送Facebook消息或发布到朋友的墙壁

问题描述:

这是我目前的设置。我可以单击一个按钮,并将图像和评论或新闻故事直接发布到我的墙上,主要是做一些简单的FBConnect或ShareKit选项。

Here is my current setup. I can click a button and post an image and a comment or news story directly to my wall, mainly just doing some simple FBConnect or ShareKit options.

我想将其扩展到更加复杂和丰富/有用的东西。我想要发表评论或新闻报道,并将其发送给Facebook上的某人,或将其发布到我朋友的任何墙壁。

I would like to expand this to something more complex and engrossing/useful. I would like to be able to take a comment or news story, and either send it in a message to someone on Facebook, or post it to any of my friend's walls.

我相信我将需要使用Facebook Open Graph来完成此任务,但不确定从哪里开始。我在Facebook上有一个应用程序设置,虽然它基本上只是为了我的应用程序的SSO的目的。有人可以指导我做一个好的教程,做我想要的和/或指导我通过在Facebook上设置我的应用程序,然后一些建议与iPhone集成

I believe I will need to use Facebook Open Graph to accomplish this, but am unsure of where to begin. I do have an App setup in Facebook, though it is essentially just for the purpose of SSO with my apps. Could someone direct me to a good tutorial to do what I would like and/or guide me through getting my app set up in Facebook, and then some suggestions for integrating with iPhone?

要发布在朋友的墙上,可以使用FB的图形API。在这里,您可以使用最小的代码段在朋友的墙上发布内容:

For posting on Friend's wall, you can use FB's graph api. Here you go with the minimal code snippet for publishing something on friend's wall:

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];