mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-23 12:06:47 +08:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user