Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
What's wrong with my code? My React Native App crashes on calling firestore without any log

Here's my implementation, I'm storing the baseURL on my firestore database. I used to sign in anonymously in order to get the url. But on calling the firestore, my app crashes without any error, warning, etc.

import {create} from 'apisauce';
import auth from '@react-native-firebase/auth';
import firestore, {firebase} from '@react-native-firebase/firestore';

const apiClient = create({
  method: 'POST',
});

apiClient.addAsyncRequestTransform(async request => {
  await auth()
    .signInAnonymously()
    .then(() => {
      console.log('success');
    })
    .catch(error => {
      console.log(error);
    });
  const url = await firestore()
    .collection('service_url')
    .doc('service_url')
    .get()
    .then(document => console.log(document.data))
    .catch(error => console.log(error));
  console.log(url);
  request.baseURL = url;
  auth().signOut();
});

export default apiClient;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem I faced was the okHTTP. It was not working with Android API 30. So, after so much workaround, I added the okhttp dependency to my project. That solved my error.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda