Skip to content

Phone-Based Login, Can You Dig It?

What's quick, secure, and gives you instantly verified users?

Here at Parse, we love helping developers create the ultimate user experience, and that often includes building seamless, secure login and signup flows. For many apps, using a phone number as a login method has become the perfect combination of consistently fast and flawless, since people don't need to a create a username or choose a password to log in.

Using Parse, it's already possible to enable phone-based login in your app. But we wanted to make it even easier to get started for developers who think this type of login might benefit their app. So we created AnyPhone, an open source iOS (Swift) and Cloud Code sample app that demonstrates phone number account creation. With this sample app, you can learn how to build phone-based login with Parse using a simple, step-by-step example. Here's how it works:

When someone initially launches AnyPhone, or when they're logged out and open the app, AnyPhone asks for the user's phone number:

anyphone-enter-phone

Text Message Verification

Once the person submits their phone number, they'll receive a text message at that number with a verification code. They enter that code on the next screen:

anyphone-2

Reusable, Cross-Platform Login

That's it! Parse creates a User account for that person in the background on first login, which will be re-used on subsequent logins. Plus, it's cross-platform — the user can log in with their phone number and access the same account from multiple mobile devices and on the web. We've added some additional data fields that allow your app to update and save information about each user, such as their name, and maintain this information across multiple sessions or devices:

anypic-main

Check out the GitHub repository here for setup instructions for the sample app. An account with Twilio is required.

With Parse and Cloud Code, there are so many capabilities available that the adventure can feel endless. We're excited to shine a light on more of these capabilities, and help you build better than ever before with sample apps like AnyPhone. We'd like to hear more about the clever things you've built on Parse—keep on sharing!