Apple reviewer can't connect to app

Hi!

I have an app that works fine on emulator or whenever I test it locally, but whenever I send to review, it’s refused because the reviewer can’t connect to the app.

The app sends ajax requests via HTTP.

The plugins I’m using are:
cordova-plugin-device
cordova-plugin-console
cordova-plugin-whitelist
cordova-plugin-network-information
cordova-sqlite-storage

Platform is iOS@6.0.0.
Anyone got any suggestion?

Thank you!

Is that actually HTTPS, or do you explicitly mean insecure plaintext HTTP?

Not sure if I got the question right. But the server which the ajax request is sent is HTTP.
I’ve had the same problem on another app, requests on HTTP as well, and it works just fine. So I’m not sure that’s the problem.

What @rapropos is asking is the url that you’re sending a request to, is it http:// or https://? All requests for your app need to connect via https

Oh, thank you!
Its HTTP. But I have just sent an app with http and it was approved.

To give some more info:
I’m having 3 errors:
Origin null is not allowed by Access-Control-Allow-Origin
XMLHtpRequest cannot load http://… due to access control checks
Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.

My fix to them was add

[configuration.preferences setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
[configuration setValue:@"TRUE" forKey:@"allowUniversalAccessFromFileURLs"];

after
WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];

But with that fix, it works fine for me but it’s being rejected by apple.

Origin null is not allowed by Access-Control-Allow-Origin
XMLHtpRequest cannot load http://… due to access control checks
Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.

This is CORS, which we have a full page dedicated to on our docs.

1 Like

I was just reading it. But was not whitelist plugin supposed to make it work?

CORS is a server-side issue, fundamentally, which no plugin can do anything about.

Thank you for your answer!
I have tried adding header(“Access-Control-Allow-Origin: *”); to the PHP file that receive the ajax requests, and still got no luck.
Tried adding cordova-plugin-cors as well.
The strange part is that it works completely fine on my end, but the reviewer can’t connect.
Any other thing I could look up into?