简体   繁体   English

如何将Facebook整合到iPhone App中

[英]How to integrate Facebook into iPhone App

I know this is an often-asked question; 我知道这是一个经常问的问题; but my point is this: what is the recommended or well-proven way to connect to FB from iPhone App. 但我的意思是:从iPhone App连接到FB的推荐或经过验证的方法是什么?

Type 1: I saw the tutorial here . 类型1:我在这里看到了本教程。 It uses AsiHttpRequest, Json libraries to post on FB wall. 它使用AsiHttpRequest和Json库发布在FB墙上。

Type 2: There is a tutorial here on Facebook site itself, which is using the same Graph API, but seems to be using different API calls to post on wall, logging in, etc. 类型2:有一个教程在这里上Facebook网站本身,这是使用相同的图形API,但好像是用不同的API调用张贴在墙上,登录等。

Which of the above two is better? 以上两个哪一个更好? Type-1 uses external libraries but the tutorial is quite explanatory. Type-1使用外部库,但本教程具有相当的解释性。 Type-2 seems to be directly from Facebook, but then no idea how updated/outdated the tutorial is (no date indicated). Type-2似乎直接来自Facebook,但不知道该教程的更新/过时程度(未注明日期)。

Type 2 was updated last Tuesday and type 1 was updated in January 2010, so I would suggest using Type 2 a) because the code is directly from Facebook and b) it is the most recent tutorial. 类型2已在上周二更新,类型1已在2010年1月更新,所以我建议使用类型2 a),因为代码直接来自Facebook,并且b)它是最新的教程。

But, the best way to integrate Facebook is to use the new iOS 6 Facebook SDK . 但是,集成Facebook的最佳方法是使用新的iOS 6 Facebook SDK

The way to go is to download the facebook API for ios (and RTFM there :-)). 方法是下载适用于ios的facebook API (以及RTFM :-)。 If you are using ios 5 compile the lib as a static lib. 如果您使用的是ios 5,则将该库编译为静态库。 Link your lib to your project and create some class wrappers to publish your app content into facebook. 将您的库链接到您的项目,并创建一些类包装器,以将您的应用程序内容发布到Facebook。 I haven't check the tutorial from Ray Wenderlich but you can probably try to do his tut with the facebook API you have build your own and is the most recent. 我还没有查看Ray Wenderlich的教程,但是您可能可以尝试使用自己构建的Facebook API来完成他的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM