Upload
romain-huet
View
51
Download
1
Embed Size (px)
Citation preview
#APIsBerlin
Build the best apps
REINVENTING IDENTITY AND SOCIAL GRAPHS WITH DIGITS
#APIsBerlin — April 24, 2015
ROMAIN HUETSr. Developer Advocate
@romainhuet
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
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
IDENTITYSTABILITYDISTRIBUTIONREVENUE
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
150M 150M
190M630M
USEUROPE
ASIA
LATAM
120MMENA
940M
Sign in with
@romainhuetRomain Huet
Twitter, Inc.Sr. Developer Advocate
[email protected]+49 173 0001337+49 173 0001337
@romainhuetRomain Huet
Twitter, Inc.Sr. Developer Advocate
[email protected]+49 173 0001337
+49 173 0001337
SMS API SMS Aggregator
$
SMS API SMS Aggregator
SMS API SMS Aggregator
¥$
SMS API
SMS API
SMS API SMS Aggregator
SMS API SMS Aggregator
¥$£
¥$€£
SMS API SMS Aggregator
SMS API SMS Aggregator
SMS API SMS Aggregator
COST PER MILLION VERIFICATIONS
Brazil $50,000
United Kingdom $33,000
Germany $60,000
Saudi Arabia $20,000
United States $5,000
POWERED BY
INITIALIZE FABRIC
import Fabric import TwitterKit
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
}
}
Fabric.with([Twitter()]) return true
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)
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”
EXTEND YOUR PROFILES
digitsUserID name profilePic
29384805 … …
23028702 … …
29484500 … …
29390084 … …
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. }
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. }
DEMO
#APIsBerlin
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>
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); });
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>
216countries
28languages
216 28
freefree
POWERED BY
WHAT’S NEW?
1530531-0k4UAv5fyP1zVNFvtTLGSzjnVHuCKcK3xEZ0MNKX8i
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(); }
});
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. }
WHAT’S NEW?
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
Grow Faster
Thank You