benwl
benwl

Reputation: 472

How to use react-native-firebase auth emulation?

im using react-native-firebase v21.6.1 and im trying to start the auth service emulation. Ive gotten the firestore and functions emulation working.

firebase.json

"emulators": {
  "functions": {
    "port": 5001
  },
  "firestore": {
    "port": 8080
  },
  "auth": {
    "port": 9099
  },
  "ui": {
    "enabled": true
  },
  "singleProjectMode": true
}

app.js:

import functions from '@react-native-firebase/functions';
import firestore from '@react-native-firebase/firestore';
import auth from '@react-native-firebase/auth';

...
if (__DEV__) {
  firestore().useEmulator('localhost', 8080);
  functions().useEmulator('localhost', 5001);
  auth().useEmulator('http://localhost:9099');
}

It seems to have connected successfully:

enter image description here

Using auth().createUserWithEmailAndPassword would throw this error:

Error: [auth/network-request-failed] A network error has occurred, please try again.]

I execute npx expo run:ios to start a development build on the ios simulator.

Upvotes: 0

Views: 17

Answers (0)

Related Questions