问题
I just started using react-native and am trying to build an android app with it.. I used create-react-native-app and used the expo template. But I'm not able to fetch data from my server kepp getting "Network Error". My server doesn't have a valid certificate currently. Is there any way to ignore ssl certificate errors in my fetch calls?
回答1:
Yes, only use the http instead https, and set the following line in your manifest
<application
...
android:usesCleartextTraffic="true"
...>
来源:https://stackoverflow.com/questions/59835051/ignore-ssl-certificates-error-in-axios-fetch-call-in-react-native-expo-android