App fails to load service because of access control check

What platform are you building for?

iOS

What framework are you building with?

Cordova

What is your build ID?

d6d97731-18d1-4749-9dac-57f98d523cc3

What is your error message?

[Error] XMLHttpRequest cannot load https://lion-ridge.net:8443/SAMPas due to access control checks.

Please describe the issue:

I have four similar apps that all access s REST service to communicate with a server located on an AWS EC2 server. The other apps access the service perfectly but this app fails to connect with an access control check. I’ve copied most of config.xml from one of the working apps but still no joy. Any idea what the problem is? PS This app worked perfectly before the recent iOS upgrade. The only change has been a change to the version number because my iOS Dev certificate is about to expire but I thought I should test in debug mode before updating the certificate

PS Prior to the access control error, I get this message: Preflight response is not successful. Status code: 302

Been having a look at the web traffic between the app and the server and comparing it with one of the working apps and it seems to be different. The apps rely extensively on third party Javascript libraries so I’m checking that both apps are using the same versions. This can be the only explanation for the differences in how the web requests are generated. Will update the item when I’ve checked

Both apps are using the same versions of the libraries. Will investigate my source code for differences but thought I’d already checked that

I think you’re on they right track. I would use remote debugging to determine the differences in the web traffic.

The fact that you’re getting a 302 on preflight seems to indicate a redirect. Could it be you are using http instead of https?

So far I’ve been using the Developer monitoring in Safari on my Mac but that doesn’t give as clear a picture of web traffic as developer mode in Chrome. What alternative remote debugging tool would you recommend? PS The same app works fine in a Chrome browser

Just checked and the app fails to work on Android as well, so it looks like there’s some flaw in the connection code in app mode but not in browser mode. So I think the problem is down to me. Will update when I’ve investigated further

Found the bug!!! Sorry to have wasted your time, will close the case now

Would you mind letting us know what the problem was?