如何使用iOS中的Fabric框架从我的应用程序中从twitter注销 [英] How can i logout from twitter from my application using fabric framework in iOS

查看:114
本文介绍了如何使用iOS中的Fabric框架从我的应用程序中从twitter注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS应用程序中,我使用结构框架 TWTRComposer 整合了Twitter登录。
首次登录并在Twitter上发布twit时工作正常。
但我无法在我的应用程序中从twitter注销。
和我第二次尝试登录时。 twitterlogin视图控制器无法打开。
所以任何人都可以使用 TWTRComposer

In my iOS application, i am integrate twitter login using fabric framework "TWTRComposer". it is working fine when first time login and post twit on twitter. but i m not able to done logout from twitter in my application. and second time when i am try to login. twitterlogin view controller not able to open. so pls any one can give me solution for successfully login and logout from my application using TWTRComposer

推荐答案

[Twitter sharedInstance] 对象有两种注销方法:logOut和logOutGuest。

The [Twitter sharedInstance] object have two method to logout : logOut and logOutGuest.

以下是文档的链接: Twitter对象iOS参考

您可以使用下面的会话参数检查用户是否已登录

Just FYI you can check if the user is logged in using the session parameter like below

[[Twitter sharedInstance] session]

如果会话为零,那么他们没有登录。

If session is nil then they are not logged in.

如果上面的东西不起作用,尝试下面的事情,可能仍然存在cookie。

Try below thing if above thing not work, It might be possible cookies still exist.

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];
    }

这篇关于如何使用iOS中的Fabric框架从我的应用程序中从twitter注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆