How can i logout from twitter from my application using fabric framework in iOS

后端 未结 4 1371
离开以前
离开以前 2021-01-21 19:50

In my iOS application, i am integrate twitter login using fabric frameworkTWTRComposer”. it is working fine when first time login and post t

4条回答
  •  执笔经年
    2021-01-21 20:07

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

    Here is the link to the docs: Twitter object iOS reference

    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.

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

提交回复
热议问题