[docs][core] apps
This commit is contained in:
parent
8ce398cf9a
commit
148bd66dfb
|
@ -1,21 +1,21 @@
|
|||
# App - firebase.app(): FirebaseApp
|
||||
## Apps
|
||||
|
||||
RNFirebase supports both initializing apps natively and also via js code over the RN bridge.
|
||||
?> For the **default** app see: [Default App](/core/default-app)
|
||||
|
||||
Apps initialized natively are available immediately at app runtime, there is no need to call `initializeApp` for them.
|
||||
?> For initializing **additional apps** natively and also via js code over the RN bridge see: [Dynamically Initializing Apps](/core/initialize-apps)
|
||||
|
||||
For example, to access the default app initialized via the `Google-Services` `plist` or `json` file:
|
||||
### Reading App Options
|
||||
|
||||
!> `<app>.options.clientId` is not available on the **Android Firebase SDK** so will return null for Android, see the issue: [firebase/firebase-ios-sdk#140 (comment)](https://github.com/firebase/firebase-ios-sdk/issues/140#issuecomment-315953708)
|
||||
|
||||
Just like the Firebase web sdk you can view options used to initialize an app instance in the same way, for example:
|
||||
|
||||
```js
|
||||
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
|
||||
// get the default app name/options that the app initialized with
|
||||
console.log("name", defaultApp.name);
|
||||
console.log("apiKey", defaultApp.options.apiKey);
|
||||
console.log("applicationId", defaultApp.options.applicationId);
|
||||
|
@ -26,9 +26,3 @@ console.log("storageBucket", defaultApp.options.projectId);
|
|||
```
|
||||
|
||||
|
||||
<!-- TODO api ref docs: -->
|
||||
<!-- - name: String -->
|
||||
<!-- - options: Object -->
|
||||
<!-- - delete(): Promise -->
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# Firebase
|
||||
|
||||
<!-- TODO api ref docs -->
|
||||
<!-- TODO - apps(): Array<FirebaseApp> -->
|
||||
<!-- TODO - app(): FirebaseApp -->
|
||||
<!-- TODO - initializeApp(): FirebaseApp -->
|
||||
<!-- TODO - setLogLevel() -->
|
||||
<!-- TODO - SDK_VERSION: String -->
|
||||
<!-- TODO - googleApiAvailability: Object -->
|
||||
TODO Reference Docs:
|
||||
|
||||
- apps(): Array<FirebaseApp>
|
||||
- app(): FirebaseApp
|
||||
- initializeApp(): FirebaseApp
|
||||
- setLogLevel()
|
||||
- SDK_VERSION: String
|
||||
- googleApiAvailability: Object
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
],
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
if (typeof navigator.serviceWorker !== 'undefined') {
|
||||
navigator.serviceWorker.register('sw.js')
|
||||
}
|
||||
</script>
|
||||
<!--<script>-->
|
||||
<!--if (typeof navigator.serviceWorker !== 'undefined') {-->
|
||||
<!--navigator.serviceWorker.register('sw.js')-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
<style>
|
||||
.markdown-section pre>code {
|
||||
|
|
Loading…
Reference in New Issue