iOS Facebook登录教程 [英] iOS Facebook Login Tutorial

查看:932
本文介绍了iOS Facebook登录教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请提供代码或指示我如何将Facebook登录功能整合到适用于所有版本的iOS应用程序中。我已经在Google和GitHub上洗了几个小时,没有一个完整的解决方案。我也在Facebook上阅读了所有的文档,并剖析了ios-facebook示例代码。我有一个工作版本为> = iOS6,但下面的任何东西都会崩溃(ACAccountStore不存在)。目前我正在使用一个名为LBFacebook的库登录。唯一的缺点是,它再也不适用于iOS5。

Please provide code or direct me to a tutorial on how to integrate Facebook login into an iOS app that works for ALL versions. I've scoured Google and GitHub for hours on end without a complete solution. I've also read all the documentation at Facebook and dissected the ios-facebook sample code. I have a working version for >=iOS6 but anything below that will crash (ACAccountStore doesn't exist). Currently I'm using a library called LBFacebook to login. The only downside is, again, it doesn't work for iOS5.

我把我的头发拉出来了。 FacebookSDK每隔几周就会改变。这是一个奇迹,让这个工作一劳永逸。

I'm pulling my hair out. The FacebookSDK changes every couple weeks. It would be miraculous to get this working once and for all.

非常感谢,

Mike

推荐答案

Facebook SDK 3.1向后兼容。它尝试按以下顺序进行身份验证:

The Facebook SDK 3.1 is backwards compatible. It tries to authenticate in this order:


  1. 帐户框架(ACAccount)

  2. 通过Facebook应用程序(如果已安装)

  3. 通过网络浏览器(旧方式)

我可以确认在较旧的iOS版本中适用于我。如果您收到ACAccountStore不存在的错误,您会出现错误。从文档中:

I can confirm it works fine for me in older iOS version. If you are getting an error that ACAccountStore doesn't exist, you are doing something wrong. From the documentation:


如果您以前没有登录,根据您的iOS版本,您将看到
本地登录模式对话框,被重定向到
Facebook的iOS或在Safari中重定向到Facebook以完成
的验证流程。

If you haven't logged in before, depending on your version of iOS, you'll see the native login modal dialog box, be redirected to the Facebook for iOS or be redirected to Facebook in Safari to complete the auth flow.

请参见此处。他们在不同的iOS版本中显示了它的外观。

See here. They show a picture of what it looks like in different iOS versions.

有关完整教程,请参阅这里

For complete tutorial see here.

这篇关于iOS Facebook登录教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆