11# NativeScript Firebase plugin
22
3- [ ![ Build Status] [ build-status ]] [ build-url ]
4- [ ![ NPM version] [ npm-image ]] [ npm-url ]
5- [ ![ Downloads] [ downloads-image ]] [ npm-url ]
6- [ ![ TotalDownloads] [ total-downloads-image ]] [ npm-url ]
7- [ ![ Twitter Follow] [ twitter-image ]] [ twitter-url ]
8-
9- [ build-status ] :https://travis-ci.org/EddyVerbruggen/nativescript-plugin-firebase.svg?branch=master
10- [ build-url ] :https://travis-ci.org/EddyVerbruggen/nativescript-plugin-firebase
11- [ npm-image ] :http://img.shields.io/npm/v/nativescript-plugin-firebase.svg
12- [ npm-url ] :https://npmjs.org/package/nativescript-plugin-firebase
13- [ downloads-image ] :http://img.shields.io/npm/dm/nativescript-plugin-firebase.svg
14- [ total-downloads-image ] :http://img.shields.io/npm/dt/nativescript-plugin-firebase.svg?label=total%20downloads
15- [ twitter-image ] :https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
16- [ twitter-url ] :https://twitter.com/eddyverbruggen
17-
183<img src =" docs/images/firebase-logo.png " width =" 116px " height =" 32px " alt =" Firebase " /><br />
194
205> For NativeScript 7 compatibility, run ` tns plugin add @nativescript/firebase ` .
216
7+ [ ![ NPM version] [ npm-image ]] [ npm-url ]
8+ [ ![ Downloads] [ downloads-image ]] [ npm-url ]
9+ [ ![ TotalDownloads] [ total-downloads-image ]] [ npm-url ]
10+ [ npm-image ] :https://img.shields.io/npm/v/@nativescript/firebase.svg
11+ [ npm-url ] :https://npmjs.org/package/@nativescript/firebase
12+ [ downloads-image ] :https://img.shields.io/npm/dm/@nativescript/firebase.svg
13+ [ total-downloads-image ] :https://img.shields.io/npm/dt/@nativescript/firebase.svg?label=total%20downloads
14+
2215> For NativeScript 6.1+ compatibility, install polugin version 10: ` tns plugin add nativescript-plugin-firebase@10 ` .
2316
2417> For NativeScript 6.0 and lower, stick to plugin version < 10.
2518
19+ [ ![ NPM version] [ npm-image-legacy ]] [ npm-url-legacy ]
20+ [ ![ Downloads] [ downloads-image-legacy ]] [ npm-url-legacy ]
21+ [ ![ TotalDownloads] [ total-downloads-image-legacy ]] [ npm-url-legacy ]
22+
23+ [ npm-image-legacy ] :https://img.shields.io/npm/v/nativescript-plugin-firebase.svg
24+ [ npm-url-legacy ] :https://npmjs.org/package/nativescript-plugin-firebase
25+ [ downloads-image-legacy ] :https://img.shields.io/npm/dm/nativescript-plugin-firebase.svg
26+ [ total-downloads-image-legacy ] :https://img.shields.io/npm/dt/nativescript-plugin-firebase.svg?label=total%20downloads
27+
2628## Features
2729* [ AdMob] ( docs/ADMOB.md )
2830* [ Analytics] ( docs/ANALYTICS.md )
@@ -118,6 +120,10 @@ We need to do some wiring when your app starts, so open `app.js` and add this be
118120
119121##### JavaScript
120122``` js
123+ // NativeScript 7+
124+ var firebase = require (" @nativescript/firebase" );
125+
126+ // NativeScript 6-
121127var firebase = require (" nativescript-plugin-firebase" );
122128
123129firebase .init ({
@@ -135,6 +141,10 @@ firebase.init({
135141
136142#### TypeScript
137143``` js
144+ // NativeScript 7+
145+ import { firebase } from " @nativescript/firebase" ;
146+
147+ // NativeScript 6-
138148const firebase = require (" nativescript-plugin-firebase" );
139149
140150firebase .init ({
@@ -153,6 +163,10 @@ firebase.init({
153163#### Angular
154164Because of the specifics of the angular bootstrap it is best to initalize firebase once the angular application is running. For example your main compoment's ` ngOnInit ` method:
155165``` js
166+ // NativeScript 7+
167+ import { firebase } from " @nativescript/firebase" ;
168+
169+ // NativeScript 6-
156170const firebase = require (" nativescript-plugin-firebase" );
157171
158172@Component ({
0 commit comments