I got a weird issue. My application is able to fetch everything from server when it is installed on Android version 5.0. However, the app cannot fetch anything from server when it is installed on Android version 4.4.
My server is using PHP code. My application is using React native code.
Here is the network code in my application which copied from React native network:
function getMoviesFromApiAsync() {
return fetch('https://facebook.github.io/react-native/movies.json')
.then((response) => response.json())
.then((responseJson) => {
return responseJson.movies;
})
.catch((error) => {
console.error(error);
});
}
When I replace the URL by my own one, the fetch function throws an error Network request fail even my real android device has strong network connection.
Here is my testing environment:
- React native version 0.57
- Android real device version 4.4
- Real URL, not locahost
If there is any solution to make the api request work for Android version 4.4, please let me know.
Thank you in advance!