I am trying to getting data from API using axios.
This is my code that makes a get request :
export const loadBloodGroups = () => {
return (dispatch) => {
dispatch({ type: LOADING_BLOOD });
const url = `http://www.example.org/api/bloodgroup/getusersbloodgroup`;
axios.get(url)
.then(response => loadingSuccess(dispatch, response))
.catch(error => loadingFail(dispatch, error));
};
};
const loadingFail = (dispatch, error) => {
console.log(error);
dispatch({
type: LOADING_BLOOD_FAIL,
payload: error
});
};
const loadingSuccess = (dispatch, response) => {
dispatch({
type: LOADING_BLOOD_SUCCESS,
payload: response
});
};
info.plist setup for http :
It works fine in android emulator, but IOS simulator is not working.
In my browser debug console it shows :
and Mac terminal it shows :
Can anybody tell me, where I made mistake ? or should I need to do any other configuration for IOS?
My platform:
- OS: Mac 10.13
- node: 10.7
- npm: 6.3.0
- react: 16.4.1
- react-native: 0.55