Free login and authentication for iOS apps using phone number

 

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading...

 

Pham Van Hoang, hoangk55cd@gmail.com, is the author of this article and he contributes to RobustTechHouse Blog

INTRODUCTION

As a developer, you may be familiar with the typical login system using emails, passwords and sign up forms.

However, have you ever found it cumbersome, repetitive and to a certain extent preventive of users from using your app?  Perhaps you have a phone-based dating application and you want to tie user’s account to something that is unique: phone number – an identity that they already use every day without the hassle of dealing (remembering) with passwords. If this idea is so incredible, so why hasn’t anyone started to build a system as such?

But wait, it doesn’t seem that easy at all. To have that feature that I have described, we need to connect to the phone service provider to verify the number and get the confirmation SMS from user. In order to achieve that, we would first need to have SMS APIs to communicate with your app, which in turn connects to a SMS Aggregator system. Next the SMS Aggregator system will need to communicate with service provider in the country where we distribute the app to verify the number and send the confirmation SMS.Free digit_01

With every million verification, it is likely to cost thousands of dollars, not to mention the efforts to ensure reliability of this system as it scales.

Free digit_02

On hind sight, that seems rather impossible. Luckily, there is Digits to solve the problem.

SO, WHAT IS DIGITS?

Digits is a brand-new way to log in to apps with just your phone number, which was announced by Twitter at its mobile developer conference in San Francisco, 2015. Moreover it is completely free and more importantly it is secure.

HOW DIGITS WORKS?

“Digits lets people create an account or sign into your app using nothing but their phone number on iOS and Android. Built using the same global, reliable infrastructure Twitter uses, Digits will verify the user’s phone number with a simple customizable user interface that easily integrates into your app.

Digits extends your existing user/profile database. A successful Digits account creation will return a stable userID to attach or match with your user record, and an oAuth token for the device”

how_digits_works

Also Digits is available now in 216 countries and in 28 languages.

Free digit_04

INTEGRATE DIGITS

Step 1: Register Fabric accounts, Fabric includes Digits and several other tools such as Crashlytics, the crash-reporting tool and MoPub, its advertising platform, and some other useful tools.

Step 2: Download and install Fabric for Xcode

Step 3: Select the project that you want to integrate Digits

 Free digit_05

Step 4: Install digits

Free digit_07

Step 5: Copy and run the scripts in the instructions. If you don’t know where to run script build phase, click the question mark button. It’ll open up the detailed instructions for you.

Free digit_06

Step 6: Follow each step in the instructions and imports Digits module in Appdelegate class

Free digit_08

Step 7: Build and run your app to confirm that it’s working as expected

Free digit_09

 

Now, Let’s Work With Some Codes

To initialize DigitsKit with your app’s credentials, pass them to startWithConsumerKey:consumerSecret: before passing the shared instance to Fabric in your app’s AppDelegate.

Calling startWithConsumerKey:consumerSecret: will override any keys which were automatically configured. Automatically configured keys resides in your app’s Info.plist under the key Fabric.

Using the pre-configured button

In the view controller that will display the button, instantiate the pre-configured button DGTAuthenticateButton after the view is loaded (e.g. in the viewDidLoad method) and provide a completion block to handle the provided session object:

This will render a button looks like:

 Free digit_10

 

Using your own button

 In the view controller that displays your custom button, capture a tap event as usual and call the authenticateWithCompletion: method with the completion block that handles the session object:

Digits let you customize the buttons and also the confirmation screen very easily.

Free digit_11

Authentication

Once users logged-in, digits will send the session which includes userID, authToken,authTokenSecret, phoneNumber for you to handle in your app. So simple, huh! There are a lot more awesome features in Digits, you can check them out on the Digits site.

If you have any questions, leave the comments below. Thanks for reading.

 

REFERENCE

Twitter Flight – Phone Number Sign In with Digits

https://get.digits.com

 

Brought to you by the RobustTechHouse team (A top app development company in Singapore).  If you like our articles, please also check out our Facebook page.

Recommended Posts
Contact Us

We look forward to your messages. Please drop us a note for any enquiries and we'll get back to you, asap.

Not readable? Change text. captcha txt
Android App Programmingdebug_01