Search code examples
twitteroauthsharekit

(iOS, ShareKit) Is there any way of determining whether or not a user is logged in to Twitter?


I am using ShareKit to add a "share to Twitter" button to my app. However I also need to show a "log out" button to allow the user to log out of his/her Twitter account. But I only want the button to show up if the user is actually logged in. Is there any way of determining whether a user has given Twitter credentials to ShareKit?


Solution

  • You can call

    [SHKTwitter isServiceAuthorized]
    

    This will return a BOOL indicating if the user has already authenticated against Twitter. As an aside, this also works against any class that subclasses SHKSharer.