Twitter digits authentication


Source link: https://github.com/Fenscode/twitter_digits_auth

Twitter Digit Authentication

Screenshot:

Home:

Phone number authentication:

What is the use of “Twitter digits authentication”?

Email and password signup is a technology that has not been innovated on in decades. Signup forms are cumbersome and repetitive. When users forget their credentials and fail to sign in, you can lose customers. So, that's why here twitter digits comes in picture. It use user's phone number to authentication user and send One time password (OTP) code on that number for authenticate genuine user for app. Twitter take phone number for authenticate user, fact behind that, phone number is easly we remember. Twitter digits provided their service for both Android and iOS.

How to integrate and use Twitter digits in your App ?

1. Add the Kit to Your app's build.gradle
buildscript {
 repositories {
 maven {
 url 'https://maven.fabric.io/public' 
}
 
}
  dependencies {
 // The Fabric Gradle plugin uses an open ended version to react // quickly to Android tooling updates classpath 'io.fabric.tools:gradle:1.+' 
}
 
}
Add following dependency to Your app's common build.gradle
apply plugin: 'io.fabric' repositories {
 maven {
 url 'https://maven.fabric.io/public' 
}
 
}
  dependencies {
 ........... compile('com.digits.sdk.android:digits:2.0.1@aar') {
 transitive = true; 
}
 
}
 
Add Your API Key at “AndroidManifest.xml”
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-permission android:name="android.permission.INTERNET" /> <meta-data android:name="io.fabric.ApiKey" android:value="****a6e7c4913e66601a*********************" /> </application> </manifest>
Tap on “Create Application” button, and create you twitter digits application. When you

made application, than your API key generated automatically.

Import packages in yor MainActivity.java
import com.digits.sdk.android.Digits; import com.twitter.sdk.android.core.TwitterAuthConfig; import com.twitter.sdk.android.core.TwitterCore;import io.fabric.sdk.android.Fabric; ## Intialize your Twitter API KEY and Twitter Secret key on TwitterAuthConfig constuctor. Both the key are available on Application dashboard. ## And after that build your your app with Fabric. public class MainActivity extends ActionBarActivity {
 @Override protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY,TWITTER_SECRET);
 Fabric.with(this, new TwitterCore(authConfig), new Digits.Builder().build());
 setContentView(R.layout.activity_main);
 
}
 ........... .......... .............. 
}
Rebuild your project:

Build your project and see everything going to work!

You can see, some demo Example on following link:

( https://fabric.io/kits/android/digits/features)

Integrate your theme in your digits App:

- Customize Digits to use your own fonts and colors.
- Create a custom theme that can be assigned to the Digits authentication screens.
1. Add your theme elements in themes.xml
<resources> <style name="CustomDigitsTheme" parent="android:Theme.Light"> <item name="android:textColorPrimary">@android:color/black</item> <item name="android:textColorSecondary">@android:color/darker_gray</item> <item name="android:windowBackground">@android:color/darker_gray</item> <item name="android:textColorLink">#ff398622</item> <item name="dgts__accentColor">#ffacee</item> </style> </resource>
2. Set the Digits theme in Mainactivity.java

To use this code you’ll need to already have a DigitsAuthButton in your app. Go through the “Sign In with Phone Number” tutorial if you need one.

Adding a theme to DigitsAuthButton will affect the entire sign in flow. You can change fonts, colors, and add your app’s logo.

Build your custom theme with Digits.Builder class.

Example:

Digits.Builder digitsBuilder = new Digits.Builder().withTheme(R.style.CustomDigitsTheme);
 Fabric.with(this, new TwitterCore(authConfig), digitsBuilder.build());

Try it out!

Run the app. You should see that after tapping on the "Use my phone number" button, your theme is applied to the Digits authentication screens.

Digits was shutdown on September 30, 2017. You can still migrate your users to Firebase Auth using the following guide.

( https://docs.fabric.io/android/digits/android-migration.html)

Resources

The RangeBar is an enhanced SeekBar widget in vertical. It provides 2 thumbs between 0-N value.

Amazing Dynamic Time UI for Android.

Log4j with the ability to send the logs to HTTP GET request's.

This project goal is to create activity fragment and views, with less code to be more efficient on the view models.

CPN

This is a small library that wraps Google Cloud Messaging solution to make it easier to implement it. It also add the ability to consume notification if the app is running at the moment of receiving the notification without additional work.

Servant will create and manage GoogleApiClient from Google Play Services for you so you can focus on the important actions and requests you want to perform with them.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes