2017/06/19 追記
DigitsはFirebaseの電話番号認証機能に統合
http://get.digits.com/blog/introducing-firebase-phone-authentication
Digitsとは
Twitterが開発した、電話番号認証を行うライブラリ。iOS、Android、Webで使える。
https://get.digits.com/
https://docs.fabric.io/web/digits/overview.html
導入
FabricからTwitterアプリを追加してCONSUMER KEYを取得
HTMLにDigitsのSDKを埋め込む
<head>
<script id="digits-sdk" src="https://cdn.digits.com/1/sdk.js" async></script>
</head>
Digitsの初期化処理
/* Initialize Digits for Web using your application's consumer key that Fabric generated */
document.getElementById('digits-sdk').onload = function() {
Digits.init({ consumerKey: 'yourConsumerKey' });
};
ボタンをクリックした時の挙動を作成する
/* Launch the Login to Digits flow. */
function onLoginButtonClick(event){
Digits.logIn()
.done(onLogin) /*handle the response*/
.fail(onLoginFailure);
}