Login and authorization are two of the most challenging user interface problems when building an app. At Twitter, we understand as much as anyone that merely having to type a password is a big cause of failure, through frustration and typos. We’ve built entire products, like Digits, to free your users from passwords, and we’re always conscious of ways to make login easier. Twitter Kit uses iOS single sign-on where possible, and now in our 2.2 release, we’re making the web flow more reliable as well with iOS 9’s Safari View Controller.
Safari View Controller provides your app with a web view that uses the same Twitter session as the Safari browser, seamlessly displayed in your app. This means people can authorize your app with a single tap, without needing to retype their Twitter credentials. Safari View Controller even includes extensions for password managers, so it’s much easier for your security-conscious users, too.
Integrating the updated flow is as easy as pasting a single line of code into your App Delegate and adding a new URL handler to your app config. With those in place, Twitter Kit will automatically use Safari View Controller for web authorizations.
Adding a new URL handler
By default, our web auth flow is used as a fallback when users don’t have a system account configured. It is also required for authorizing special permissions such as reading direct messages and requesting email addresses. Twitter Kit 2.2 makes that experience faster and easier for your users.
As Twitter Kit gains new functionality, we’re constantly listening to your feedback to iterate and improve the fundamentals as well. To learn more about integrating Safari View Controller in your app, check out the updated documentation and ask away in the forum.