简体   繁体   English

iOS Facebook SDK:哪种登录系统更好?

[英]iOS Facebook SDK: which login system is better?

I am developing a iOS application which allows users to login by using their Facebook account. 我正在开发一个iOS应用程序,该应用程序允许用户使用其Facebook帐户登录。

I managed to implement the login procedure thanks to official tutorial I found here https://github.com/facebook/facebook-ios-sdk . 由于在https://github.com/facebook/facebook-ios-sdk上找到了官方教程,我设法实现了登录过程。 I found here https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/authenticate/ another tutorial which looks pretty different since in the first tutorial the user signs in through Safari, instead in the second tutorial the native Facebook App is used. 我在这里找到https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/authenticate/另一个教程看起来很不一样,因为在第一个教程中,用户通过Safari登录,而在第二个教程中,用户通过Safari登录使用Facebook App。

Among these two systems, which one is better? 在这两个系统中,哪个更好? Perhaps by using Safari I could avoid any issue concerning back compatibility with older versions of iOS? 也许通过使用Safari,我可以避免有关与旧版iOS的向后兼容性的任何问题?

Thanks! 谢谢!

If you're using the official Facebook SDK, here's what happens: 如果您使用的是官方的Facebook SDK,则会发生以下情况:

  • If a user does have the Facebook app installed, they'll be taken to it to authenticate and login to your app. 如果用户确实安装了Facebook应用,则将带他们进行身份验证并登录到您的应用。

  • If the user does not have the Facebook app installed, they'll be taken to Safari to authenticate and login to your app. 如果用户安装Facebook应用,则他们将被带到Safari进行身份验证并登录到您的应用。

Either way, the login process is the same. 无论哪种方式,登录过程都是相同的。 After they authenticate, they're returned to your app using a specific URL scheme so that you can continue with what you're doing. 他们进行身份验证后,将使用特定的URL方案将其返回到您的应用程序,以便您可以继续进行操作。

Finally, if you're targeting iOS 6 only, you can take advantage of the single sign on features built into iOS. 最后,如果您仅针对iOS 6,则可以利用iOS内置的单点登录功能。 Check the docs for more information on that. 检查文档以获取更多信息。

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

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