简体   繁体   English

Facebook iOS SDK与社交框架

[英]Facebook iOS SDK vs Social framework

I want to write app that is heavily integrated with Facebook. 我想写一个与Facebook紧密集成的应用程序。 I'm not sure what shoud I use - sdk provided by Facebook or new Social Framework provided by Apple. 我不确定我使用的是什么 - 由Facebook提供的sdk或Apple提供的新社交框架。 Do you know some pros and cons of them? 你知道它们的优点和缺点吗?

[EDIT] I ended using Social Framework provided by Apple, because it's much easier to integrate, It will be develop in future, and I have access to device owner Facebook account, so user don't have to log in to Facebook when using my app. [编辑]我最终使用Apple提供的社交框架,因为它更易于集成,它将在未来开发,并且我可以访问设备所有者Facebook帐户,因此用户在使用我的帐户时无需登录Facebook应用程序。 I want to do some custom stuff, so I get oauth token from ACAccountCredential and then I make requests with AFNetworing to Facebook's Graph API. 我想做一些自定义的东西,所以我从ACAccountCredential获得oauth令牌,然后我用AFNetworing向Facebook的Graph API发出请求。

The Social Framework is designed for simple, site-neutral data manipulation. 社交框架专为简单,站点中立的数据操作而设计。 Examples might include getting the user's 'activity feed' (as described by the docs) or posting a new status or photo. 示例可能包括获取用户的“活动供稿”(如文档所述)或发布新状态或照片。 It currently works with Twitter, Facebook and Weibo however, other than lack of features, the current main disadvantage is that it is limited to iOS 6, which won't be as much of a problem in the future. 它目前适用于Twitter,Facebook和微博,但除了缺乏功能外,目前的主要缺点是它仅限于iOS 6,这在未来不会成为问题。

On the other hand Facebook does have an iOS SDK that makes it reasonably easy to integrate Facebook into your app, and it is much more powerful than the Social Framework. 另一方面,Facebook确实有一个iOS SDK,可以很容易地将Facebook集成到您的应用程序中,并且它比社交框架更强大。 Another benefit is that support goes back to iOS 4.3. 另一个好处是支持可以追溯到iOS 4.3。

I'd recommend using the Facebook iOS SDK over writing your own custom one and using OAuth because Facebook has already done the work for you. 我建议使用Facebook iOS SDK而不是编写自己的自定义版本并使用OAuth,因为Facebook已经为您完成了这项工作。

I've struggled with this decision for a long time and came to this conclusion. 我很长一段时间都在努力做出这个决定,并得出了这个结论。 If your app doesn't care for iOS 5 and older phones, then the iOS Social framework is the way to go, as it allows the user to share with any of the popular social outlets (Facebook, Twitter, email, Weibo, SMS...) just like one can do in mobile safari. 如果你的应用不关心iOS 5和更旧的手机,那么iOS社交框架就是可行的方式,因为它允许用户与任何流行的社交网点(Facebook,Twitter,电子邮件,微博,短信)分享。 ..)就像人们可以在移动野生动物园中做的那样。 According to Apple, 89% of the iDevices are already on iOS 7. The percentage will be higher if you include iOS 6. 根据Apple的说法,89%的iDevices已经在iOS 7上。如果你包含iOS 6,这个百分比会更高。

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

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