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}