“I’m building an Ionic 2 starter with social login using Firebase!” said hundreds of developers participating in the Ionic 2 beta. Yeah, I’m doing it as well. It’s not a bad idea. Usually, if your app uses online data your users will be required to login. Creating a starter app —– a set of code from which you can base a new application upon —– would certainly save time and effort creating new applications. In this case it will also give you a good feel for the new way of doing things in Ionic 2. And Firebase is a great service that allows you to easily create social logins.
I’ve attempted to create my social login starter for weeks. There are several Firebase-related Angular 2 example apps available on github that were created using AngularFire 2 or just using the Firebase TypeScript definitions, but I could only get one of them to actually work. One problem has been that AngularFire, the project that everyone uses with Firebase in their Angular 1 projects, simply hasn’t been ready for use with Angular 2.
Below you’ll find a link to the AngularJS Mountain View Meetup March meeting video which has several really great presentations. The feature presentation is AngularFire in Angular 2 by Jeff Cross and David East. While riddled with sarcasm, the presentation is also riddled with great information on how to use AngularFire 2.
Using the code samples from this presentation, I was able to create a authentication service in Ionic 2 that uses Google, Twitter and github social login. I’ll post information about that project in the coming weeks.
AngularFire 2 is still in development and I haven’t used it for anything beyond social login so far. As always, #EverythingIsInBeta so your mileage may vary.
The AngularFire 2 presentation starts the 28 minute mark, but don’t be afraid to watch the entire set of presentations. I found the “How to create an Angular 2 app from scratch” presentation very valuable.