0

I have migrated my cordova app from android 9 to android 10. As per documentation I removed the whitelist plugin as whitelisting is not required in android 10 and above.

My app stopped working after migration. It is giving a CORS error on xhr requests. I have added <access origin="*" /> and <allow-navigation href="*" /> in my config.xml file.

After adding preference for hostname <preference name="hostname" value="xyz.company.com" /> it started working as expected. But I support multiple hostnames for my app like xyz.company.com, pqr.company.com. Is there any way to provide a generic hostname which will work for all server names?

Thanks in advance.

Sandeep
  • 131
  • 1
  • 10
  • You need to set the CORS dynamically on the server side, see this thread https://stackoverflow.com/questions/14003332/access-control-allow-origin-wildcard-subdomains-ports-and-protocols – Eric Feb 25 '23 at 18:16

0 Answers0