Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

HTTPS calls are not working in React Native

$
0
0

I am developing an API call in React Native using Axios but I am not able to hit the backend after release using ./gradlew assembleRelease. in debugging mode the calls are happening, but I don't understand why it is not happening in Build Release. Where's the backend is developed in Node & Express.

Heres the code I am attaching:

App.tsx

 React.useEffect(() => {       getData().then(d => {           setData(d.data)       })    }, [getData])

Services.ts

    const getData = async () => {        axios.defaults.headers.Accept = "application/json";        return axios.get(`https://XX.XXX.XX.XXX/course`)            .then((resultant) => {                console.log(resultant)                return resultant.data;            })            .catch((error) => {                console.error(error);            });}export {getData}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>