I am following the documentation of twitter and below is the example code they have given to check logged in user session and tweet using the TWTRComposer.
// Check if current session has users logged in
if ([[Twitter sharedInstance].sessionStore hasLoggedInUsers]) {
TWTRComposerViewController *composer = [TWTRComposerViewController emptyComposer];
[fromController presentViewController:composer animated:YES completion:nil];
} else {
[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) {
if (session) {
TWTRComposerViewController *composer = [TWTRComposerViewController emptyComposer];
[fromController 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];
}
}];
}
Now, for the case when Twitter app is not installed, the flow goes to the else part given below:
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];
}
Twitterkit should open webview here to ask for twitter login, which is not happening. Anyone have any clue? Any help would be greatly appreciated.
Thanks & Cheers.