Using Cocoapods TwitterKit 3.2.1
iPhone 6, iOS 10 and 11,
I was able to share to Twitter app just fine if the user is already logged in for Twitter app. But if I try to share while logged out, the Twitter app asks for login. After successful log in, there is no redirecting back to my app. Why is there no redirecting after successful log in? It seems to work if using the WebView login.
[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession * _Nullable session, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (session != nil) {
TWTRComposerViewController *composer =
[[TWTRComposerViewController alloc]
initWithInitialText:message
image:nil
videoURL:strongSelf.videoUrl];
composer.delegate = self;
[strongSelf presentViewController:composer animated:YES completion:nil];
} else if (error) {
[strongSelf.progressView setHidden:YES];
if (error.code != TWTRLogInErrorCodeCancelled) {
//handle error
}
}
});
}];