Twitter Kit iOS does not authorize account



Twitter Kit iOS does not authorize account when the Twitter iOS application already exist on iPhone.

I use TwitterKit and when Twitter application installed on iOS device my application’s Twitter share property opens the installed twitter application to authorize page but when i select “connect” button on page then return back to my application.
When i try to share with Twitter second time again opens the installed twitter application to authorize page.
This scenario continually going on.

Besides if iPhone does not include Twitter iOS application everthing working good. It opens authorize page on safari and works perfectly.

Please quick help…

Here is my code

if ([[Twitter sharedInstance].sessionStore hasLoggedInUsers]) {
    TWTRComposerViewController *composer = [TWTRComposerViewController emptyComposer];
    composer.delegate = self;
    [self presentViewController:composer animated:YES completion:nil];
} else {
    [[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) {
        if (session) {
            TWTRComposerViewController *composer = [TWTRComposerViewController emptyComposer];
            [self presentViewController:composer animated:YES completion:nil];
        } else {
            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"No Twitter Accounts Available" message:@"You must log in before presenting a composer." preferredStyle:UIAlertControllerStyleAlert];
            [self presentViewController:alert animated:YES completion:nil];

Note: I implemented everything to integration on this( Twitter installation page.


I believe I’m seeing the same problem. See: [BUG] Twitter Kit iOS 3.0.4 login sometimes fails to redirect back to host app