Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!