diff --git a/docs/_sidebar.md b/docs/_sidebar.md index b76d61ee..c0a02a90 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -9,6 +9,10 @@ - [Guidelines](/contributing/guidelines) - [Testing](/contributing/testing) +- Core + - [App](/core/app) + - [Firebase](/core/firebase) + - Modules - [Admob](/modules/admob) - [Analytics](/modules/analytics) diff --git a/docs/core/app.md b/docs/core/app.md new file mode 100644 index 00000000..a1ee0d47 --- /dev/null +++ b/docs/core/app.md @@ -0,0 +1,34 @@ +# App + +RNFirebase supports both initializing apps natively and also via js code over the RN bridge. + +Apps initialized natively are available immediately at app runtime, there is no need to call `initializeApp` for them. + +For example, to access the default app initialized via the `Google-Services` `plist` or `json` file: +```javascipt +import firebase from 'react-native-firebase'; + +const defaultApp = firebase.app(); + +defaultApp.database().ref('foobar').once('value', (snapshot) => { + // snapshot from default app +}); + +// get the default app name/options that were initialized natively +console.log("name", defaultApp.name); +console.log("apiKey", defaultApp.options.apiKey); +console.log("applicationId", defaultApp.options.applicationId); +console.log("databaseUrl", defaultApp.options.databaseUrl); +console.log("messagingSenderId", defaultApp.options.messagingSenderId); +console.log("projectId", defaultApp.options.projectId); +console.log("storageBucket", defaultApp.options.projectId); +``` + + +TODO api ref docs: + + - name: String + - options: Object + - delete(): Promise + + diff --git a/docs/core/firebase.md b/docs/core/firebase.md new file mode 100644 index 00000000..43cd33e8 --- /dev/null +++ b/docs/core/firebase.md @@ -0,0 +1,10 @@ +# Firebase + +TODO api ref docs: + + - apps(): Array + - app(): FirebaseApp + - initializeApp(): FirebaseApp + - setLogLevel() + - SDK_VERSION: String + - googleApiAvailability: Object