TwitterKit 3.0.4 Opening link in Safari browser, as the host is not whitelisted



I’ve recently update TwitterKit to 3.0.4. I’ve done the installation instructions from the site and I’ve put the URLShema at the first place in plist file as suggested in here.
But after the user login in the SafariViewController I’m getting message

Opening link in Safari browser, as the host is not whitelisted: twitterkit-<myConsumerKey >://callback?app=<myConsumerKey>&oauth_token=<token>&oauth_verifier=<oauth>

Am I missing something?


I’m seeing the same issue


I’m also seeing this, but it doesn’t appear to cause any problems?


In my case the control never returns to the application, the safari view control just sits there displaying “redirecting you back to the application”


Hey guys, have you tried updating to TwitterKit 3.1.0 to see if the issue persists?


Literally in the process of trying this now, will post with results momentarily.

Done. result is the same… The login attempt just hangs up in Safari and never redirects back to the app, with the message Opening link in Safari browser, as the host is not whitelisted: twitterkit-1234://callback?app=1234&oauth_token=jUj20gAAAAAA0tk9AAABXht3qJc&oauth_verifier=5XeKcrimVQbrjmJvsb5GaG84wsabzC6z

note: I replaced the app id with 1234


Thanks for checking that! Could you provide me with more information about how your app is set up (plist file with the keys obfuscated, how you are implementing the twitterkit stuff in app delegate and how you are using twitterkit in your app)?



Sure, in applicationDidFinishLaunchingWithOptions we’ve got

Twitter.sharedInstance().start(withConsumerKey: "foo", consumerSecret: "bar"),

then in info.plist,


And then this for Fabric, not sure if the Kit config here is redundant or not now, we’ve migrated a few times.


and lastly


and logging in with

Twitter.sharedInstance().logIn(completion: { session, error in 


Are you implementing the method for opening URLs in your AppDelegate?

// Swift
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
   return Twitter.sharedInstance().application(app, open: url, options: options)


Just took a look and this method was not implemented - implementing it seems to have resolved the issue. Assuming this is necessary now for the v3+ version of twitterkit?


Yes I think this is part of v3+ release, it’s referenced here in the documentation.


@_paulbuchanan @The_Dudi can you guys also confirm if this fixes your issue?


The web view login works just fine for me. I have the app delegate URL handling method implemented. I do see the message on the console about not being white listed, but everything seems to work fine with login. That message must not be meaningful.


Guys, i have did all the implementation right, it didn’t work with 3.4 it kept on going to twitter app, then go to web view and then display this error.

I started going back version by version until 3.0.0 worked out, so do the following:

pod 'TwitterKit', '~>' , :inhibit_warnings => true
pod 'TwitterCore', '~>', :inhibit_warnings => true

This should work perfectly, and call Twitter.sharedInstance().application(app, open: url, options: options), I’ve tested it with latest twitter app it worked to login, if app is not installed then it will show the web view and thats all .