Contents

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.

[[Digits sharedInstance] startWithConsumerKey:@"your_key" consumerSecret:@"your_secret"];
[Fabric with:@[[Digits sharedInstance]]]

Using the pre-configured button

// Objective-C
- (void)viewDidLoad {
    DGTAuthenticateButton *digitsButton = [DGTAuthenticateButton buttonWithAuthenticationCompletion:^(DGTSession *session, NSError *error) {
        // Inspect session/error objects
    }];
    [self.view addSubview:digitsButton];
}

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.

// Objective-C
- (void)didTapButton {
    [[Digits sharedInstance] authenticateWithCompletion:^(DGTSession *session, NSError *error) {
        // Inspect session/error objects
    }];
}

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
Showing 25 comments
  • 에볼루션카지노

    Je ne suis pas vraiment un lecteur Internet pour être honnête mais vos blogs vraiment sympa, continue comme ça ! 에볼루션카지노 Je vais aller de l’avant et ajouter votre site à vos favoris pour revenir à l’avenir. advgamble.com

  • safetoto

    I have been looking for articles on these topics for a long time. safetoto I don’t know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day

  • Carl S. Brewer

    I am grateful for this informative information. Keep up the good job and grab any chance to develop. geometry dash meltdown may be used to play games.

  • Color By Number

    Thank you for the great articles on this site; I will bookmark those links and return to them frequently. Have a wonderful day!

  • Marianne Yates

    I was reading your article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent. connections game

  • 8 Ball Pool

    This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information.

  • vampire survivors

    Your essay made me wonder whether you had considered writing an ebook on this topic.

  • roknalbostan

    “This post has left me inspired and awestruck.”
    شركة تركيب طارد الحمام بالمدينة المنورة

  • wordle unlimited

    That’s great! They’re exactly what I’m looking for! Thank you for sharing these wonderful and rewarding things with me and all of you!

  • Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our.

  • naila

    This is some great information. I expect additional facts like this was distributed across the web today. Grams to cups

  • Naila

    Enjoyed looking at this, very good stuff, thanks . New york buffalo single women

  • Naila

    Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can’t help but wonder, what about the other side? !!!!!!Thanks Best Place To Buy Peptides Online

  • seo expert

    Thanks for this grand post, I am glad I observed this website on yahoo. cayenne pepper benefits

  • aa

    Wow! Such an amazing and helpful post this is. I really really love it. It’s so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also Sweet Georgia Weed

  • puravive

    This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article. puravive

  • aa

    I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. شركة نقل عفش بابها فك وتركيب

  • aa

    This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future… slot gacor hari ini

  • naila

    Keep in touch whilst functioning from your own home office with out all of the hassle of purchasing or procurment costly office equipment. Debtors are allowed to apply with their a bad credit score background whenever. cat ninja game

  • Dabwoods

    I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well!

  • aaa

    What a thrilling post, you have pointed out some excellent points, I as well believe this is a superb website. I have planned to visit it again and again. buy ebook

  • aa

    I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! Modern dining tables and chairs for gatherings

  • AYAN

    Kantorbola merupakan agen judi online yang menyediakan beberapa macam permainan di antaranya slot gacor, livecasino, judi bola, poker, togel dan trade. kantor bola juga memiliki rtp tinggi 98% gampang menang kantor bola

  • aa

    This is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. health

  • are

    I got too much interesting stuff on your blog. I guess I am not the only one having all the enjoyment here! Keep up the good work. ole777

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
Reasons why your Business Mobile App is not as Successful as ExpectedHow to Ensure Stability for Your Web App