[docs] Update Android instructions and misc module page fixes (#2601)

This commit is contained in:
Pablo Kebees
2019-09-19 18:01:41 +01:00
committed by Mike Diarmid
parent 1734b9e8ae
commit d277f92164
41 changed files with 228 additions and 70 deletions

View File

@@ -3,4 +3,54 @@ title: Android Setup
description: Manually integrate Cloud Firestore into your Android application.
---
# Android Manual Linking
# Android Manual Installation
The following steps are only required if you are using React Native <= 0.59 or need to manually integrate the library.
#### Update Gradle Settings
Add the following to your projects `/android/settings.gradle` file:
```groovy
include ':@react-native-firebase_firestore'
project(':@react-native-firebase_firestore').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/firestore/android')
```
#### Update Gradle Dependencies
Add the React Native Firestore module dependency to your `/android/app/build.gradle` file:
```groovy{3}
dependencies {
...
implementation project(path: ":@react-native-firebase_firestore")
}
```
#### Add package to the Android Application
Import and apply the React Native Firebase module package to your `/android/app/src/main/java/**/MainApplication.java` file:
Import the package:
```java
import io.invertase.firebase.analytics.ReactNativeFirebaseFirestorePackage;
```
Add the package to the registry:
```java{4}
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactNativeFirebaseFirestorePackage(),
```
#### Rebuild the project
Once the above steps have been completed, rebuild your Android project:
```bash
react-native run-android
```

View File

@@ -49,5 +49,5 @@ Our documentation is a great place to start, however if you're looking for more
check out the resources below:
- [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-firebase-firestore)
- [Github Issues](https://github.com/invertase/react-native-firebase/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Aupdated-desc+label%3Afirestore+)
- [Github Issues](https://github.com/invertase/react-native-firebase/labels/Service%3A%20Firestore)
- [Firebase Documentation](https://firebase.google.com/docs/firestore?utm_source=invertase&utm_medium=react-native-firebase&utm_campaign=firestore)

View File

@@ -8,7 +8,7 @@ description: Getting started with Cloud Firestore in React Native Firebase
## Module usage
This module depends on the `@react-native-firebase/app` module. To get started and install `app`,
visit the projects <Anchor version={false} group={false} href="/quick-start">quick start</Anchor> guide.
visit the project's <Anchor version={false} group={false} href="/quick-start">quick start</Anchor> guide.
The Cloud Firestore module follows the same API as the [Web SDK](https://firebase.google.com/docs/reference/js/firebase.firestore), however takes advantage of the native SDKs. This provides advantages such as improved performance versus using the Web SDK, as all work is carried out natively in separate threads, preventing issues such as [jank](https://facebook.github.io/react-native/docs/performance#js-frame-rate-javascript-thread). The module also works in offline mode, using device storage.