React Native Firebase: The story so far

A brief history of where we’ve been and where we’re going.

Chris Bianca
4 min readOct 5, 2017

As of Christmas 2018, I am no longer a part of Invertase or the React Native Firebase team, but I’m still heavily involved with Firebase, React and React Native at CS Frequency.

2016 – State of play

Just under a year ago, Mike, Elliot and I happened to be working on separate React Native projects that needed to use Firebase as a backend. At the time there were two options – the official Firebase JS SDK or the React Native Firestack library. The former supported the realtime database and authentication, but had limited storage support for React Native and no offline persistence. The latter had set about implementing native support for some of the other Firebase modules, i.e. storage and auth.

Independently, we all decided to use react-native-firestack but quickly came across a number of issues:

  • The API was completely bespoke and didn’t have any resemblance to the official JS SDK
  • There was differing functionality for iOS and Android
  • Documentation was limited at best, which meant interpreting the bespoke API was a nightmare

We decided to try and put this right, and set about working on a new version of react-native-firestack which matched the JS SDK, brought iOS and Android support in line and improved the documentation – helped by the ability to reference the official JS SDK documentation.

Rogue project owners

After several months of effort, people had started moving over to the version we’d been working on which is when we started encountering some issues. Pull Requests were being submitted but as we weren’t the project owners we had no control over them despite having developed the new version. Then, to make things worse, the project owner merged the PRs without any testing and completely broke the database module.

With a general lack of response from the project owner we’d had enough.

React Native Firebase v1

We decided to port the new version of the library over to its current home and pledged to follow a couple of guiding principles:

  • Where possible, the react-native-firebase library should follow the JS SDK
  • Functionality should be available on both Android or iOS before being released as part of the library

It also gave us the flexibility to completely start again, binning bits of the code that we weren’t happy with, and breaking backwards compatibility to ensure that everything we delivered matched the JS SDK and worked consistently across both platforms.

After over 6 months of development we launched v1 on the 2nd May 2017 with at least basic support across a range of modules: Analytics, Authentication, Cloud Messaging (FCM), Crash Reporting, Performance Monitoring, Realtime Database, Remote Config and Storage.

React Native Firebase v2

Over the next couple of months we continued fleshing out functionality across the modules that we already supported, added in support for Admob and introduced one of the more radical changes to the react-native-firebase architecture.

In v1, the library consisted of a single module, meaning that if you wanted to use react-native-firebase you’d need to install all of the Firebase modules that we supported. This meant that even if you only wanted Analytics functionality, you’d have to install Auth, Database, Cloud Messaging, et. al. Not ideal for your application size!

With the launch of v2 on 4th July 2017, every react-native-firebase module was now completely independent and optional, meaning that you only needed to install the modules that you were interested in. A massive change, but one that has helped build the traction that the library has today.

React Native Firebase v3

3rd October 2017 was our biggest release day yet!

Two words, phone auth — probably the most requested feature we’ve ever had for the library, and single handedly the most controversial when it came to how to implement. After many a heated discussion we finally settled on a dual implementation:

  1. Replicating the Web SDK’s signInWithPhoneNumber functionality
  2. A more customisable verifyPhoneNumber API which exposed the added functionality available within Android

We also added support for multiple apps (including a complete re-work of the internals to allow this to work smoothly), simplified app initialisation and have made the first time setup installation even simpler.

That wasn’t all though — if you missed Firebase’s big announcement this week about Cloud Firestore, then make sure you check it out because, that’s right, we’d been beavering away to make sure we had support ready to go for launch.

Where to next?

We’re just getting started with react-native-firebase and we’ve got lots planned over the coming weeks and months: better documentation, continued support of ongoing Firebase SDK changes, working towards full native SDK coverage, and lots more goodies.

If there’s anything you feel we’re missing, or could be doing to support you more, please let us know! You can follow us here, on Twitter, over at the main GitHub repo or chat with us on Discord.

Thanks for reading! If you liked this story, please click the 👏 below so other people will see it on Medium (it really helps, otherwise it doesn’t get into others’ feeds). Sharing on Facebook and re-tweeting is appreciated too!

--

--

Chris Bianca

Co-founder & CTO of Shoppr. Striving to streamline the shopping experience for customers everywhere.