在我的 iOS 应用程序中,我使用集成 Twitter 登录织物框架 “TWTR作曲家”。
第一次登录并在 Twitter 上发布推文时,它工作正常。
但我无法在我的应用程序中从 Twitter 注销。
当我第二次尝试登录时。 twitterlogin 视图控制器无法打开。
所以请任何人都可以给我成功的解决方案登录和注销从我的应用程序使用TWTR作曲家
The [Twitter sharedInstance]
对象有两种注销方法:logOut 和 logOutGuest。
这是文档的链接:Twitter 对象 iOS 参考 https://dev.twitter.com/twitter-kit/ios-reference/twitter
仅供参考,您可以使用如下所示的会话参数检查用户是否已登录
[[Twitter sharedInstance] session]
如果会话为零,则他们未登录。
如果以上方法不起作用,请尝试以下方法,可能 cookie 仍然存在。
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *each in cookieStorage.cookies) {
// put a check here to clear cookie url which starts with twitter and then delete it
[cookieStorage deleteCookie:each];
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)