Slide 1

Slide 1 text

#APIsBerlin Build the best apps

Slide 2

Slide 2 text

REINVENTING IDENTITY AND SOCIAL GRAPHS WITH DIGITS #APIsBerlin — April 24, 2015

Slide 3

Slide 3 text

ROMAIN HUET Sr. Developer Advocate @romainhuet

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

IDENTITY STABILITY DISTRIBUTION REVENUE

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Individuals Using the Internet, 2005-2014 (ITU) People (Millions) 0 750 1500 2250 3000 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 Internet Users

Slide 17

Slide 17 text

150M 150M 190M 630M US EUROPE ASIA LATAM 120M MENA 940M

Slide 18

Slide 18 text

Sign in with

Slide 19

Slide 19 text

@romainhuet Romain Huet Twitter, Inc. Sr. Developer Advocate [email protected] +49 173 0001337 +49 173 0001337

Slide 20

Slide 20 text

@romainhuet Romain Huet Twitter, Inc. Sr. Developer Advocate [email protected] +49 173 0001337 +49 173 0001337

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

SMS API SMS Aggregator $

Slide 25

Slide 25 text

SMS API SMS Aggregator SMS API SMS Aggregator ¥ $

Slide 26

Slide 26 text

SMS API SMS API

Slide 27

Slide 27 text

SMS API SMS Aggregator SMS API SMS Aggregator ¥ $ £

Slide 28

Slide 28 text

¥ $ € £ SMS API SMS Aggregator SMS API SMS Aggregator SMS API SMS Aggregator

Slide 29

Slide 29 text

COST PER MILLION VERIFICATIONS Brazil $50,000 United Kingdom $33,000 Germany $60,000 Saudi Arabia $20,000 United States $5,000

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

POWERED BY

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

INITIALIZE FABRIC import Fabric import TwitterKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { } } Fabric.with([Twitter()]) return true

Slide 36

Slide 36 text

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)

Slide 37

Slide 37 text

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”

Slide 38

Slide 38 text

EXTEND YOUR PROFILES digitsUserID name profilePic 29384805 … … 23028702 … … 29484500 … … 29390084 … …

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

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. }

Slide 41

Slide 41 text

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. }

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

DEMO #APIsBerlin

Slide 45

Slide 45 text

ADD DIGITS TO YOUR WEB APP Welcome to Cannonball Sign In with Phone

Slide 46

Slide 46 text

ADD DIGITS TO YOUR WEB APP document.getElementById('digits-sdk').onload = function() { }; // 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); });

Slide 47

Slide 47 text

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. }); // Validate the authentication and sign the user in. function onLogin(loginResponse) { }

Slide 48

Slide 48 text

216 countries 28 languages 216 28

Slide 49

Slide 49 text

free free

Slide 50

Slide 50 text

POWERED BY

Slide 51

Slide 51 text

WHAT’S NEW?

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

1530531-0k4UA v5fyP1zVNFvtT LGSzjnVHuCKc K3xEZ0MNKX8i

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

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(); } });

Slide 59

Slide 59 text

FIND FRIENDS // Retrieve the contact matches. Digits.getInstance().getContactsClient().lookupContactMatches(null, null, new ContactsCallback() { }); @Override public void success(Result result) { if (result.data.users != null) { // Process contacts data. } } @Override public void failure(TwitterException exception) { // Show error. }

Slide 60

Slide 60 text

WHAT’S NEW?

Slide 61

Slide 61 text

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

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Grow Faster

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Thank You