Firebase support for Ionic/Cordova

Cristian Olaru
Web Native
Published in
2 min readJun 19, 2018

Firebase is not just a real-time database as it was at the beginning. After being acquired by Google it becomes the facto serverless solution for mobile. It is not just a replacement for the closed Parse.com and its various clones: http://parseplatform.org. It is an ecosystem for creating serverless backends for your mobile applications with a multitude of features: https://firebase.google.com/products. Some of them are exposed with a Web SDK, but others have just Native SDKs for iOs and Android.

The Firebase Native SDKs support in Ionic/Cordova is not so good as in other mobile frameworks like React Native or Native Script. And, Firebase Web SDK is not covering all the functionalities (for example there is no Web support for Analytics — https://firebase.google.com/docs/analytics/ or Remote Config — https://firebase.google.com/docs/remote-config/).

In React Native we have excellent support: RNFirebase https://rnfirebase.io/docs/v4.2.x/getting-started
In Native Script we have nativescript-plugin-firebase — https://github.com/EddyVerbruggen/nativescript-plugin-firebase (it has even ML Kit support inside)

In Cordova we have a series of different plugins, each specific to one feature of the Firebase ecosystem — https://firebase.google.com/products (some of them are integrated into Ionic Native — https://ionicframework.com/docs/native) :
1. cordova-plugin-firebase — https://github.com/arnesson/cordova-plugin-firebase (the most complete plugin with support for Cloud Messaging, Remote Config, Analytics)
2. Firebase Analytics — https://ionicframework.com/docs/native/firebase-analytics/
3. Firebase Config — https://ionicframework.com/docs/native/firebase-config/
4. Firebase Dynamic Links — https://ionicframework.com/docs/native/firebase-dynamic-links/
5. Firebase Messaging — https://ionicframework.com/docs/native/firebase-messaging/
6. FCM — https://ionicframework.com/docs/native/fcm/

7. Authentication — https://github.com/chemerisuk/cordova-plugin-firebase-authentication

The problem with this multitude of Cordova plugins is the lack of integration — we will always have issues with the Google Play Services library used on Android, and we will be forced to use other plugins like cordova-android-play-services-gradle-release — https://github.com/dpa99c/cordova-android-play-services-gradle-release, cordova-android-firebase-gradle-release — https://github.com/dpa99c/cordova-android-firebase-gradle-release

Also, there is no support in Ionic/Cordova for Firebase AdMob, Crashlytics, Performance Monitoring, App Indexing, ML Kit.

You can follow me on Twitter where I continue to document my next steps.

--

--