I just started a new project, in which I am reusing a component I used earlier in another Ionic v3 project. No modifications were done to the code.
The “fetch” simply gets a json from a server (not mine, operator ftp server), and my previous project can fetch that json without problem. Now the same code, used in a new project, is throwing a CORS error whenever I deploy my test app to Android.
Any clues as to what might be going wrong?
The only plugin I saw, which might have an effect on the fetch, is cordova-plugin-ionic-webview 3.1.1
Part of the code:
await fetch(CHANNELSURL, {
method: 'GET',
headers: {
'Accept': 'application/json, text/plain',
'Content-Type': 'application/json, text/plain',
'Cache-Control': 'no-cache',
'Save-Data': 'off',
'Connection': 'close'
}
})
.then(response => {
return response.json();
})