Experience TwitterKit login failure while Twitter app is not installed


I am facing this problem which I found some other poster said that was fixed in version 3.1, however, I am still having this issue. If Twitter app is not installed on device, it did not fall back to use SFSafariViewController while valid callback url is provided.

And the reason I am sure that callback url is correct is because that I actually tried to handle the OAuth with an UIWebview myself and did get accessToken back correctly from my server. However, I want to use TwitterKit to login the user without handling OAuth myself.

BTW, I did check my server log, it did not look like the callback url was being called when I login user on the client side. Which is weird because I use the same url when I handle OAuth myself.

Any suggesstion?

TwitterKit: Latest version
Device: iPhone 6
iOS: 11.2.2


So I just figure it out by myself. For some reasons if user has no twitter api installed on the device, the callback trigger by the TWTRTwitter.login function url scheme is changed to lowercased.

For example, the origin url scheme I caught in the AppDelegate was ‘twitterkit-XYXYXYXY’ (if user has twitter app installed), it becomes ‘twitterkit-xyxyxyxy’ if user has no twitter app installed.

Weird but worked after handle it.