[英]Clearing of app cache in iOS works for Google+ login, but doesn't work for Facebook
In my app I implemented login using Facebook and Google+. 在我的应用中,我使用Facebook和Google+实现了登录。 Given scenario:
给定方案:
Which is ok end expected. 可以的。 User needs to log out from Safari browser.
用户需要从Safari浏览器注销。 But I would like to do it by myself by cleaning cookies and URLCache:
但是我想自己通过清理cookie和URLCache来做到这一点:
URLCache.shared.removeAllCachedResponses()
URLCache.shared.diskCapacity = 0
URLCache.shared.memoryCapacity = 0
if let cookies = HTTPCookieStorage.shared.cookies {
for cookie in cookies {
HTTPCookieStorage.shared.deleteCookie(cookie)
}
}
This code erases data for Google+, but doesn't change anything for Facebook. 这段代码会删除Google+的数据,但不会更改Facebook的任何数据。 Is it the expected behavior?
这是预期的行为吗? Why?
为什么? If no - what is the way to clean Facebook data as well?
如果不是,那么清除Facebook数据的方法也如何?
You can try this way. 您可以尝试这种方式。 When you use FB to login you can first use logout
使用FB登录时,您可以先使用注销
FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
//manager.loginBehavior=FBSDKLoginBehaviorWeb;
[manager logOut];
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.