Reinventing Identity and Social Graphs with Digits

65
#APIsBerlin Build the best apps

Transcript of Reinventing Identity and Social Graphs with Digits

Page 1: Reinventing Identity and Social Graphs with Digits

#APIsBerlin

Build the best apps

Page 2: Reinventing Identity and Social Graphs with Digits

REINVENTING IDENTITY AND SOCIAL GRAPHS WITH DIGITS

#APIsBerlin — April 24, 2015

Page 3: Reinventing Identity and Social Graphs with Digits

ROMAIN HUETSr. Developer Advocate

@romainhuet

Page 4: Reinventing Identity and Social Graphs with Digits

crashes spam identity dropped frames lag

performance threading memory leaks churn

getting downloads driving installs revenue

in-app-purchases revenue monetization user feedback

validation distribution support user accounts

testing graphics icons deep links localization

internationalization data storage persistence analytics

content interest graphs stability

Page 5: Reinventing Identity and Social Graphs with Digits

crashes spam identity dropped frames lag

performance threading memory leaks churn

getting downloads driving installs revenue

in-app-purchases revenue monetization user feedback

validation distribution support user accounts

testing graphics icons deep links localization

internationalization data storage persistence analytics

content interest graphs stability

Page 6: Reinventing Identity and Social Graphs with Digits
Page 7: Reinventing Identity and Social Graphs with Digits
Page 8: Reinventing Identity and Social Graphs with Digits

IDENTITYSTABILITYDISTRIBUTIONREVENUE

Page 9: Reinventing Identity and Social Graphs with Digits
Page 10: Reinventing Identity and Social Graphs with Digits
Page 11: Reinventing Identity and Social Graphs with Digits
Page 12: Reinventing Identity and Social Graphs with Digits
Page 13: Reinventing Identity and Social Graphs with Digits
Page 14: Reinventing Identity and Social Graphs with Digits
Page 15: Reinventing Identity and Social Graphs with Digits
Page 16: Reinventing Identity and Social Graphs with Digits

Individuals Using the Internet, 2005-2014 (ITU)Pe

ople

(M

illio

ns)

0

750

1500

2250

3000

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014

Internet Users

Page 17: Reinventing Identity and Social Graphs with Digits

150M 150M

190M630M

USEUROPE

ASIA

LATAM

120MMENA

940M

Page 18: Reinventing Identity and Social Graphs with Digits

Sign in with

Page 19: Reinventing Identity and Social Graphs with Digits

@romainhuetRomain Huet

Twitter, Inc.Sr. Developer Advocate

[email protected]+49 173 0001337+49 173 0001337

Page 20: Reinventing Identity and Social Graphs with Digits

@romainhuetRomain Huet

Twitter, Inc.Sr. Developer Advocate

[email protected]+49 173 0001337

+49 173 0001337

Page 21: Reinventing Identity and Social Graphs with Digits
Page 22: Reinventing Identity and Social Graphs with Digits
Page 23: Reinventing Identity and Social Graphs with Digits
Page 24: Reinventing Identity and Social Graphs with Digits

SMS API SMS Aggregator

$

Page 25: Reinventing Identity and Social Graphs with Digits

SMS API SMS Aggregator

SMS API SMS Aggregator

¥$

Page 26: Reinventing Identity and Social Graphs with Digits

SMS API

SMS API

Page 27: Reinventing Identity and Social Graphs with Digits

SMS API SMS Aggregator

SMS API SMS Aggregator

¥$£

Page 28: Reinventing Identity and Social Graphs with Digits

¥$€£

SMS API SMS Aggregator

SMS API SMS Aggregator

SMS API SMS Aggregator

Page 29: Reinventing Identity and Social Graphs with Digits

COST PER MILLION VERIFICATIONS

Brazil $50,000

United Kingdom $33,000

Germany $60,000

Saudi Arabia $20,000

United States $5,000

Page 30: Reinventing Identity and Social Graphs with Digits
Page 31: Reinventing Identity and Social Graphs with Digits

POWERED BY

Page 32: Reinventing Identity and Social Graphs with Digits
Page 33: Reinventing Identity and Social Graphs with Digits
Page 34: Reinventing Identity and Social Graphs with Digits
Page 35: Reinventing Identity and Social Graphs with Digits

INITIALIZE FABRIC

import Fabric import TwitterKit

@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {

}

}

Fabric.with([Twitter()]) return true

Page 36: Reinventing Identity and Social Graphs with Digits

INVOKE DIGITS

import TwitterKit

class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad()

}

}

let authenticateButton = DGTAuthenticateButton(authenticationCompletion: { (session: DGTSession!, error: NSError!) in // Store the Digits session in your backend. })

authenticateButton.center = self.view.center self.view.addSubview(authenticateButton)

Page 37: Reinventing Identity and Social Graphs with Digits

DIGITS SESSION

let button = DGTAuthenticateButton { (session, error) in

if session != nil {

} }

println(session.userID) // “2834242790”

println(session.authToken) // “2834242790-5gsoS8ABHybf7SfsWgPXhqmDet843uleJM8hsVa”

println(session.authTokenSecret) // “xLDdKyEc1SQDrtyobMWZ14dbnL224e4PKxAeGPu4Ibzew”

println(session.phoneNumber) // “+491730001337”

Page 38: Reinventing Identity and Social Graphs with Digits

EXTEND YOUR PROFILES

digitsUserID name profilePic

29384805 … …

23028702 … …

29484500 … …

29390084 … …

Page 39: Reinventing Identity and Social Graphs with Digits
Page 40: Reinventing Identity and Social Graphs with Digits

USE YOUR OWN BUTTON

import TwitterKit

class ViewController: UIViewController {

@IBAction func didTapButton(sender: AnyObject) {

}

}

Digits.sharedInstance().authenticateWithCompletion { (session, error) in // Inspect the Digits session/error objects. }

Page 41: Reinventing Identity and Social Graphs with Digits

THEME YOUR DIGITS EXPERIENCE

import TwitterKit

class ViewController: UIViewController {

@IBAction func didTapButton(sender: AnyObject) {

}

}

let digitsAppearance = DGTAppearance() digitsAppearance.backgroundColor = UIColor.blackColor() digitsAppearance.accentColor = UIColor.greenColor()

Digits.sharedInstance().authenticateWithDigitsAppearance(digitsAppearance, viewController: nil, title: nil) { (session, error) in // Inspect the Digits session/error objects. }

Page 42: Reinventing Identity and Social Graphs with Digits
Page 43: Reinventing Identity and Social Graphs with Digits
Page 44: Reinventing Identity and Social Graphs with Digits

DEMO

#APIsBerlin

Page 45: Reinventing Identity and Social Graphs with Digits

ADD DIGITS TO YOUR WEB APP

<!DOCTYPE html> <html> <head> <title>Welcome to Cannonball</title> <meta charset="UTF-8">

</head>

<body> <button id="digits-btn">Sign In with Phone</button>

<script id="digits-sdk" src="https://cdn.digits.com/1/sdk.js" async></script>

</body> </html>

Page 46: Reinventing Identity and Social Graphs with Digits

ADD DIGITS TO YOUR WEB APP<script> document.getElementById('digits-sdk').onload = function() {

}; </script>

// Set a click event listener on the button. document.getElementById('digits-btn').addEventListener("click", onLoginButtonClick); // Implement the login button callback and handle the response. function onLoginButtonClick() { Digits.logIn().done(onLogin).fail(onLoginFailure); }

// Initialize Digits and check if the user is already logged into Digits. Digits.init({ consumerKey: "o0gzicSS27GgtEJsu7wT442SG" }).done(function() { Digits.getLoginStatus().done(onLoginStatus); });

Page 47: Reinventing Identity and Social Graphs with Digits

VERIFY A DIGITS TOKEN & RETRIEVE USER INFO

// Parse the OAuth Echo headers. var oAuthEchoHeaders = loginResponse.oauth_echo_headers; var verifyData = { credentials: oAuthEchoHeaders['X-Verify-Credentials-Authorization'], apiUrl: oAuthEchoHeaders['X-Auth-Service-Provider'] };

// Post this data and from your server, securely request over SSL // the user information including the phone number. $.post('/verify', verifyData).done(function() { // Update the user interface with user information. });

<script> // Validate the authentication and sign the user in. function onLogin(loginResponse) {

} </script>

Page 48: Reinventing Identity and Social Graphs with Digits

216countries

28languages

216 28

Page 49: Reinventing Identity and Social Graphs with Digits

freefree

Page 50: Reinventing Identity and Social Graphs with Digits

POWERED BY

Page 51: Reinventing Identity and Social Graphs with Digits

WHAT’S NEW?

Page 52: Reinventing Identity and Social Graphs with Digits
Page 53: Reinventing Identity and Social Graphs with Digits
Page 54: Reinventing Identity and Social Graphs with Digits

1530531-0k4UAv5fyP1zVNFvtTLGSzjnVHuCKcK3xEZ0MNKX8i

Page 55: Reinventing Identity and Social Graphs with Digits
Page 56: Reinventing Identity and Social Graphs with Digits
Page 57: Reinventing Identity and Social Graphs with Digits
Page 58: Reinventing Identity and Social Graphs with Digits

FIND FRIENDS

// Initialize the Find Friends button from the view. findFriendsButton = (Button) findViewById(R.id.find_your_friends_button);

// Set a listener on the Find Friends button. findFriendsButton.setOnClickListener(new View.OnClickListener() {

@Override public void onClick(View view) { // Start uploading the Address Book. Digits.getInstance().getContactsClient().startContactsUpload(); }

});

Page 59: Reinventing Identity and Social Graphs with Digits

FIND FRIENDS

// Retrieve the contact matches. Digits.getInstance().getContactsClient().lookupContactMatches(null, null, new ContactsCallback<Contacts>() {

});

@Override public void success(Result<Contacts> result) { if (result.data.users != null) { // Process contacts data. } }

@Override public void failure(TwitterException exception) { // Show error. }

Page 60: Reinventing Identity and Social Graphs with Digits

WHAT’S NEW?

Page 61: Reinventing Identity and Social Graphs with Digits

As we continue to grow internationally, Digits is extremely helpful. Many of our customers prefer to verify their accounts via phone, so

Digits is the easiest solution for them and us.”

- Sean Smith,Senior Director, Client Engineering, Rdio

Page 62: Reinventing Identity and Social Graphs with Digits
Page 63: Reinventing Identity and Social Graphs with Digits

Grow Faster

Page 64: Reinventing Identity and Social Graphs with Digits
Page 65: Reinventing Identity and Social Graphs with Digits

Thank You