Phone-based Sign Up on Android using AccountKit + Firebase

Firebase is great for building mobile apps without writing much server code. Unfortunately, it does not provide a way for signing up users using a One Time Password (OTP) sent by SMS. That’s where Facebook’s AccountKit does a great job.

AccountKit and Firebase are both great, but it takes some work to make them work together. I’ve created a helper class and some simple server code that to take away the complexity and provide a simple integration.

Demo

Here’s the result of the code that follows:

I hope I’ll get around to writing a detailed tutorial at some point, but for now I’m just putting up the code with some documentation. It assumes that you have set up AccountKit and Firebase in your app already (links to setup instructions are provided).

Code

The helper class ‘FirebaseAccountKit’ takes the result from the AccountKit login flow and creates a Firebase user by connecting to the server endpoint ‘server.js’. ‘AccountKitLoginActivity’ demonstrates the usage of ‘FirebaseAccountKit’.

This post is probably not too helpful in its current form, but I’m putting it up just in case this is exactly what somebody is looking for! ;-)

References

Founder, Jovian