iphone - 如何在 Twitter Rest API v1.1 中从 FHSTwitterEngine 完全注销?

标签 iphone ios objective-c twitter

FHSTwitterEngine *engine = [FHSTwitterEngine sharedEngine];
[engine clearAccessToken];

我尝试了上面的代码,但是当我尝试再次登录时,文本字段没有出现在 presentModalViewController 中,它显示授权应用程序按钮。

还有另一种方法,[engine clearConsumer]; 其结果是 Select and Copy the PIN in presentModalViewController

最佳答案

我相信 cookie 仍然存在,这是 iOS 上大多数 Twitter API 的主要问题。

这是检查所有 cookie 的方法,在两者之间进行检查以仅清除在 Twitter 上执行注销操作的 Twitter 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];
    }

希望对您有所帮助。

问候,

雷诺琼斯

关于iphone - 如何在 Twitter Rest API v1.1 中从 FHSTwitterEngine 完全注销?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17499999/

相关文章:

ios - 为导航栏创建一个粘性 View

ios - 没有为 iOS 应用程序生成 Google Analytics 人口统计数据

ios - 更新到 Xcode 10.2、Swift 5 后 `' NBPhoneNumberDesc.h ' file not found`

ios - 如何将手机图库中的图片添加到 UITableView

iphone - PDF 417 检测和解码

ios - 将 dbmanager 数据填充到 UITableView

iphone - subarrayWithRange 具有大数据

ios - 使用SCRecorder时访问权限错误

Objective-c - 在静态 NSMutableDictionary 上使用 NSCache 的好处?

sendsynchronousRequest 的 IOS 问题