如何从Twitter Rest API v1.1中的FHSTwitterEngine完全注销? [英] How to get completely logout from FHSTwitterEngine in Twitter Rest API v1.1?
问题描述
FHSTwitterEngine *engine = [FHSTwitterEngine sharedEngine];
[engine clearAccessToken];
我尝试了上面的代码但是当我再次尝试登录时,textfields并没有在<$ c中出现$ c> presentModalViewController ,它显示授权应用程序按钮。
I tried above code but when I try to login again, textfields doesn't apear in presentModalViewController
, it shows Authorize app button.
还有另一种方法, [engine clearConsumer];
结果选择并复制PIN
in presentModalViewController
There is another method, [engine clearConsumer];
which results Select and Copy the PIN
in presentModalViewController
推荐答案
我相信cookies仍然存在,这是iOS上大多数Twitter API的主要问题。
I believe cookies still exists, that's the major issue with most of the twitter APIs on iOS.
这是你如何检查所有cookie,检查之间只清除你在twitter上执行注销操作的twitter cookies:
This is how you can check for all cookies, put a check in between to clear only twitter cookies where you are performing a logout operation on twitter:
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];
}
希望有所帮助。
问候,
Reno Jones
Reno Jones
这篇关于如何从Twitter Rest API v1.1中的FHSTwitterEngine完全注销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!