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

React native Android - network request failed error with fetch() method

$
0
0

Currently, my app is not working, and it prints out an error message "network request failed".

The URL is correct - the URL is woking properly in Chrome, however, it only not working on the android.

I am assuming that it is basically because I am using private certificate for https.

Below is my code, please let me know if you find an answer.

fetch(url) .then(res => res.json()) .then( (result) => { const companyName = result['name']; const companyId = 'ID '+ result['id'];

      this.setState({        isLoaded: true,        siteData: result,        companyName: companyName,        companyID: companyId      });    }  )  .catch((error) => {    console.log(error);    this.setState({      isLoaded: false,      error    });  });

Viewing all articles
Browse latest Browse all 30336

Trending Articles



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