[docs] start of app/core documentation

This commit is contained in:
Salakar 2017-07-17 19:41:51 +01:00
parent 48570f5510
commit 471539a1aa
3 changed files with 48 additions and 0 deletions

View File

@ -9,6 +9,10 @@
- [Guidelines](/contributing/guidelines)
- [Testing](/contributing/testing)
- Core
- [App](/core/app)
- [Firebase](/core/firebase)
- Modules
- [Admob](/modules/admob)
- [Analytics](/modules/analytics)

34
docs/core/app.md Normal file
View File

@ -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

10
docs/core/firebase.md Normal file
View File

@ -0,0 +1,10 @@
# Firebase
TODO api ref docs:
- apps(): Array<FirebaseApp>
- app(): FirebaseApp
- initializeApp(): FirebaseApp
- setLogLevel()
- SDK_VERSION: String
- googleApiAvailability: Object