简体   繁体   English

iOS的Facebook SDK登录

[英]Facebook SDK Login for iOS

Using Facebook's iOS SDK, how does a developer figure out if a user has signed out of his/her account in either Safari/Facebook app? 使用Facebook的iOS SDK,开发人员如何确定用户是否已在Safari / Facebook应用程序中退出其帐户? If a developer is saving the access token and expiration date in the app between app launches, is there any flag within the SDK to let the developer know that the phone user has actually signed out/changed accounts? 如果开发人员在两次启动之间将访问令牌和到期日期保存在应用程序中,SDK中是否有任何标志可让开发人员知道电话用户实际上已经注销/更改了帐户? I want a user of my app to have to sign in with the new account if they have changed accounts from a third party app. 我希望我的应用程序用户如果已经从第三方应用程序更改了帐户,则必须使用新帐户登录。

The Facebook SDK has a 'isSessionValid' method that you can call, but that method's implementation only checks to see if there is an accesstoken and if the expiration date is past a certain point. Facebook SDK有一个'isSessionValid'方法,您可以调用该方法,但是该方法的实现仅检查是否有访问令牌以及到期日期是否超过了某个时间。 It does not check to see if the user has signed off or changed accounts from a different app. 它不会检查用户是否已从其他应用程序注销或更改了帐户。

Any ideas? 有任何想法吗?

The current design is that once a user has logged into an ios client app and the app has an auth token, the user is in until the auth token expires or the user uninstalls the FB app (or deletes the app from their device). 当前的设计是,一旦用户登录ios客户端应用程序并且该应用程序具有身份验证令牌,该用户便会进入身份验证身份,直到身份验证令牌过期或用户卸载FB应用程序(或从其设备中删除该应用程序)为止。 Suppose you have a server involved where your ios client hands the auth token to the server (they're the same FB app). 假设您有一个服务器,您的ios客户端将auth令牌交给服务器(它们是相同的FB应用)。 That server would never know that another FB app on that device had logged out. 该服务器永远不会知道该设备上的另一个FB应用已注销。 Your user will probably have to use the logout method in Facebook.m. 您的用户可能必须使用Facebook.m中的注销方法。

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

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