Wrong app authorization redirect in Twitter App



I have an app with 3 targets ( dev, prod, staging ). Each target has his own app created on twitter dashboard and his own API Key and secret Key. I am using TwitterKit for iOS, in Swift. At app launch in Appdelegate the good keys/secrets and urlScheme are properly setup for Twitter in function of the running target. My tests shows that Twitter successfully register the good keys/secrets and urlScheme.
When I use the logIn() method, if the Twitter app is not installed on the device, everything works good since logIn() will present a modal Twitter WebView.
The issue is when the Twitter app is installed in the user’s device, calling logIn() with a target ( staging for example ) will work the first time showing the good app authorization infos via the Twitter app. If I use another target ( dev for example ) it will show the previous app authorization via the Twitter app. To make it work I must kill the Twitter app and relaunch it if I want to login via another target, then it will work and make the same issue.
So I guess there is a bug in the iOs Twitter app.


Thank you for reporting. The bug is fixed and merged on Twitter for iOS app but not on app store yet.
The authorization flow will be fixed with the app update by end of this month.


Thanks for fixing it, I’m glad I participated in ameliorating the public Twitter app !

Have a great day.

Adrien Yvon