I have created a React Native app which uses a WebView. In the WebView I have managed to load a local HTML file, local CSS files and local JS files. So far so good.
The problem I am facing is this: My Javascript functions need to perform fetch() requests (GET and POST) to 3rd party endpoints. I get CORS errors because, because the WebView's origin is http://192.168.1.4:8081 and as you would guess this origin isn't registered into my server's CORS allow list.
My research so far is unfruitful. Is anyone aware of a way where I can specify the origin of the fetch() requests? In fact I need something similar to the html and baseURL combination, but I want the baseURL to apply only to the fetch() requests.
Thank you