docs(firestore): emulator documentation (#3690)

* format(*): ran formatting script

* docs(firestore): added emulator docs

* chore(firestore): typedoc generate

* docs(firestore): with sidebar

* chore(firestore): generate docs

* docs(firestore): spelling/grammar

* chore(app): reversed test index

* chore(firestore): emulator update

* chore(firestore): emulator docs and code

* fix(firestore): emulator configuration

* chore(firestore): code review update

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>

* chore(firestore): rm http protocol

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
[publish]
This commit is contained in:
Russell Wheatley
2020-06-03 13:53:04 +01:00
committed by GitHub
parent 31ca27fa03
commit 7a5a1ced6f
8 changed files with 2061 additions and 1816 deletions

View File

@@ -22,6 +22,7 @@ import {
isObject,
isString,
isUndefined,
isAndroid,
} from '@react-native-firebase/app/lib/common';
import {
createModuleNamespace,
@@ -210,6 +211,15 @@ class FirebaseFirestoreModule extends FirebaseModule {
"firebase.firestore().settings(*) 'settings.host' must not be an empty string.",
);
}
if (isAndroid) {
if (settings.host.startsWith('localhost')) {
settings.host = settings.host.replace('localhost', '10.0.2.2');
}
if (settings.host.startsWith('127.0.0.1')) {
settings.host = settings.host.replace('127.0.0.1', '10.0.2.2');
}
}
}
if (!isUndefined(settings.persistence) && !isBoolean(settings.persistence)) {