We’ve developed a Cordova app in Visual Studio 2017 which communicates with a WebAPI 2.0 RESTful service. The Android app successfully communicates with the server, but the Apple iOS app fails with an error code of 0. The server has a valid certificate and tests from https://www.ssllabs.com/ssltest/index.html show that TLS 1.2 is in place and will be used for Apple Transport Security. We have logging in the API and it appears that the Apple app does not enter the API at all. There is also nothing in the IIS logs showing that a POST was made to the server.
Here’s a code snippet…
- $.ajax({
- type: "POST",
- url: webService + "Login/",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify(loginViewModel),
- dataType: "json",
- crossdomain: true,
- async: true,
- headers: { 'X-Requested-With': 'XMLHttpRequest' }
- })
- .done(function (incomingUserData) {
-
- loadMainPage();
- endBusy();
- })
- .fail(function (jqXHR, textStatus, errorThrown) {
-
- });
Any help is greatly appreciated.