TwitterKit 3.0.3 - share same twitter app (consumer key and secret) between multiple apps



Hi there,

we have an online platform that is used by several iOS apps. All of them can sign in the user authenticated via Twitter. This requires using the same (twitter) consumer key and secret across all iOS apps.
This creates a problem now that the consumer key is added to the Info.plist to redirect the user from the Twitter app back to the calling app. We can have multiple apps installed on the phone with the same URL scheme.

Is it possible to differenciate the URL scheme in any way? Facebook SDK uses custom suffix we can add to the URL scheme to allow that.
As alternative, can I force the usage of SFSafariViewController only? So the Twitter app is not used and there is no redirect to handle.

Thank you so much!

[BUG] Twitter kit iOS 3.0.4 authenticating with Twitter app installed
[BUG] Twitter Kit iOS 3.0.4 login sometimes fails to redirect back to host app
[BUG] Twitter Kit iOS 3.0.4 login sometimes fails to redirect back to host app

This issue is still present in 3.0.4 and I cannot understand why this is not taken in consideration.
My proposed solution will avoid any possible issue of authenticating the wrong app, when OAuth is handled by Twitter app.

Related bugs

Thank you


The old version of TwitterKit (2.8.1) is more flexible because it allows you to force the login flow on Webview/Safari (using the method parameter TWTRLoginMethod) and so this problem is not happening.

Please re-introduce, at least, this old behavior.
Thank you


We have this issue also with Twitter SDK 3.1.1 and I have Twitter 7.8 on my iOS device.

When we try to use TWTRComposer, the user is taken to the Twitter app to the “Connect your account” view.
If user taps “Connect” button, the Twitter app will redirect the user back to a different app.

I guess Twitter/iOS can’t differentiate between the apps via the CFBundleURLSchemes?


Is there any update regarding this issue?
How are you handling the issue for now?


I ended up implementing my own login flow using oauth and SafariViewController.
This way I can avoid the problem all together


Do you still face this issue?
I checked with latest twitter application and twitter kit. It is still happening for me.
Is it same for you?
Are you still solving it in the same way?


Yes, I still use my own login implementation with OAuth and SafariViewController.

I haven’t check again TwitterKit or the app since then.


But I really don’t know why don’t they answer your problem.
If we should use separate consumer key and secret for each application, they should mention this at least.
It’s not a simple issue to ignore.


For your information, the Official Twitter Kit SDK is now deprecated and will NOT BE SUPPORTED ANYMORE