2017-07-17 20:56:08 +01:00
|
|
|
# App - firebase.app(): FirebaseApp
|
2017-07-17 19:41:51 +01:00
|
|
|
|
|
|
|
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:
|
2017-08-26 05:49:34 +01:00
|
|
|
|
|
|
|
```js
|
2017-07-17 19:41:51 +01:00
|
|
|
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);
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2017-08-26 06:48:26 +01:00
|
|
|
<!-- TODO api ref docs: -->
|
2017-08-26 06:50:03 +01:00
|
|
|
<!-- - name: String -->
|
|
|
|
<!-- - options: Object -->
|
|
|
|
<!-- - delete(): Promise -->
|
2017-07-17 19:41:51 +01:00
|
|
|
|
|
|
|
|