如何在iOS App中完全注销Facebook SDK Auth [英] How to completely Logout of Facebook SDK Auth in iOS App
问题描述
使用FBSDKCoreKit 4.22.1
using FBSDKCoreKit 4.22.1
我公开安装了一个应用程序,在白天为多个用户提供服务。一个人可以走到iPad并使用他们的Facebook帐户登录:
I have an app installed publicly, servicing multiple users during the day. A person can walk up to the iPad and login with their Facebook account:
成功登录后,可以完成他们的工作并使用应用程序而不是他们将在稍后注销:
After successful login, than can do their work and use the app and than they will logout some time later:
Logout发生成功。然后下一个用户开始使用公共iPad并点击Facebook登录按钮,但他们会看到:
The Logout happens successfully. Then the next user comes up to use the public iPad and clicks the Facebook Login button, yet they will see:
FBSDKLoginManager或其他Facebook SDK Libs记住了之前用户Facebook登录的一些元素。
The FBSDKLoginManager or other Facebook SDK Libs has remembered some elements of the previous user's Facebook login.
我想彻底清除有关以前用户的Facebook凭据的任何信息
成功注销后,调用此 FBSDKLoginButtonDelegate
方法,我已尝试以下方法完全删除Facebook帐户信息没有成功:
After successful Logout, this FBSDKLoginButtonDelegate
method is called and I have tried the following to completely remove the Facebook account info with no success:
func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
print("\(#function) in \(#file.components(separatedBy: "/").last ?? "")")
print("Todo, must completely remove Facebook Auth token info for current user logging out")
FBSDKAccessToken.setCurrent(nil)
FBSDKLoginManager().logOut()
FBSDKProfile.setCurrent(nil)
}
所以使用FBSDKCoreKit 4.22.1 Safari浏览器用于打开Facebook身份验证重定向URL,Javascript使用本地存储:
So with FBSDKCoreKit 4.22.1 Safari browser is used to open the Facebook authentication redirect URL and that Javascript uses local storage:
有趣的是,阻止所有Cookie,Apple暗示也将阻止网站数据(localStorage),不阻止本地存储和Facebook仍然创建网站数据存储:
Interestingly, Blocking all Cookies, which Apple implies will also block Website Data (localStorage), does NOT block local storage and Facebook and still create Web Site data stores:
Apple说这里:
更改哪个cookie接受s和网站数据:选择Cookies和网站数据选项:
"Change which cookies and website data are accepted: Select a "Cookies and website data" option:"
- 始终阻止:Safari不允许任何网站,第三方或
广告客户在您的Mac上存储Cookie和其他数据。这可能是
阻止某些网站正常工作。
这就是我希望本地存储也被阻止的地方作为cookie但Facebook仍然可以创建本地存储条目
And that is where I expect Local Storage to be blocked as well as cookies but Facebook can still create local storage entries
推荐答案
我能够通过更改 FBSDKLoginBehavior
到网上,请看: https://stackoverflow.com/a/44101753/1258525
I was able solve my this issue by changing the FBSDKLoginBehavior
to web, see here: https://stackoverflow.com/a/44101753/1258525
这篇关于如何在iOS App中完全注销Facebook SDK Auth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!