On iOS 9.3.5 with Twitter Kit 3.0.4 if you initiate a login request when the Twitter app is installed, you will get an iOS dialog prompt asking if the Twitter app should be opened (results from calling openUrl: with a custom scheme) If the user cancels this dialog, no further actions are taken by Twitter kit, including not calling the login completion block back. On iOS 10 and iOS 11 beta, when the user cancels the dialog, TwitterKit falls back to launching a web view for authentication. Not calling the completion block back in a user cancel scenario is bad because host applications can’t update their UI in response to the user cancelling. Steps:
Pre req: Make sure Twitter app is installed on an iOS 9 device
If you have previously accepted the openurl dialog, you can reset this by going to Settings > General > Reset > ‘Erase all settings’
- Make call to Twitter.sharedInstance().logIn
- Tap cancel on the “AppName” wants to open “Twitter” dialog
- Observe that the web view is not launched, nor is the login completion block called
Sample app: https://www.dropbox.com/s/5c5538v7vyh2ewi/TwitterAuthTest.zip?dl=0