Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

106
Vistas
Are there preventions to making HTTPS request on IOS for React Native? Can't make fetch requests on IOS with React Native

so I'm trying to create a get request to the Google OAuth2 API in React Native using React Query, where I pass in an authorization header and I'm supposed to get basic information about that user, like their name, email, profile pic. The code works and retrieves the data on the Web and Android, but does not work on IOS. As of now, I've tried using different ways of fetching the data, like Axios, instead of the built in fetch function, but it's always stuck on loading.

Here's the code for making the fetch request:

const { isLoading, error, data } = useQuery("userData", async () => {
    const response = await fetch(
      "https://www.googleapis.com/oauth2/v3/userinfo",
      {
        method: "GET",
        headers: {
          Accept: "application/json",
          Authorization: `Bearer ${accessToken}`,
          "Content-Type": "application/json",
        },
      }
    );
    return await response.json();
  });

where the access token is retrieved through a useContext call. This is what I return from my component:

return (
    <View
      style={{
        backgroundColor: "green",
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      <Text style={{ color: "white" }}>{data.email}</Text>
    </View>
  );
};
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda