Digits: now themed to your app

Wednesday, 17 December 2014

In October, we unveiled Digits, a simple and secure phone-based sign-in solution that’s free for both developers and users. Today we’re excited to release theming support, a new feature that lets you make Digits blend into your apps, on both iOS and Android.

Digits: now themed to your app

We understand how crucial your app’s sign-in experience is to growing and retaining your user base. Digits can already be launched from any button anywhere within your app to optimize that experience. Now, with theming support, you can match Digits exactly to your app’s ambience so the Digits sign-in flow looks indistinguishable from your app. The look and feel of your background, call-to-action button and select text are all customizable.

Digits: now themed to your app

Theming requires just a few lines of code, and Digits will do the rest. Take McDonald’s as an example. On Android, simply create a new theme with the desired background and accent colors:

#ff121314
#ffd7262e

Afterwards, just set the theme by passing it as parameter on the Digits authenticate method:

Digits.authenticate(callback,R.style.MyTheme);

On iOS, create a DGTAppearance object that specifies your colors, and either (a) set the button appearance property to that object (when using the built-in button DGTAuthenticateButton), or (b) pass it to the authenticateWithAppearance: method (when using a custom button). Here’s an example using the tap handler method of your custom button:

DGTAppearance *digitsAppearance = [[DGTAppearance alloc] init];
digitsAppearance.backgroundColor = [UIColor blackColor];
digitsAppearance.accentColor = [UIColor greenColor];

Digits *digits = [Digits sharedInstance];
[digits authenticateWithDigitsAppearance:digitsAppearance viewController:nil title:nil completion:^(DGTSession *session, NSError *error) {
// Inspect session/error objects
}];,

However your app looks, Digits will fit right in. If you’re interested in Digits, visit dev.twitter.com/fabric for Fabric and the Twitter Kit. If you already have Digits, see our docs for Android or iOS to learn more about theming.