I'm having a problem when I receive my JSON in a React Native app.
I'm doing a simple fetch request to get it
getApplicationList()
{
return fetch('http://192.168.X.X/index.php')
.then((response) => response.json())
.then((responseJson) => {
return responseJson;
})
.catch((error) => {
return 'There has been a problem with your fetch operation: ' + error.message;
});
}
but when I make a console.error(getApplicationsList());
in the render function, I'm getting a very bizarre log on the android emulator:
console.error: {"_40":"0","_65":"0","_55":"null","_72":"null"}
In my PHP file, I'm returning a JSON encoded response, and when I type my URL (with 'localhost') in the navigator I can get it.
When I launch the app from the emulator, I change the localhost adress with my computer IP, and when I type this URL in the browser, I'm getting a Cannot GET /index.php
response. I don't know if it's alright, and I'm feeling a little lost between all of this.
Many thanks for your help