1

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) {

                // Load the user's home page
                loadMainPage();

                endBusy();
            })
            .fail(function (jqXHR, textStatus, errorThrown) {

        // throw an error
            });

Any help is greatly appreciated.

Terry V
  • 11
  • 1

1 Answers1

0

This is similar to this question, where the user is facing an identical issue.

According to him, this is due to the Specific Websites Only security restriction:

Any website which uses secure SSL encryption must be explicitly whitelisted because iOS’s Internet content filter cannot examine the encrypted “https” content. Encrypted websites that are not on the Only Allow These Websites list will be blocked automatically by iOS’s Internet content filter.

You'll have to manually whitelist your URL here:

enter image description here

I hope this solves your issue, otherwise let me know.

andreszs
  • 2,896
  • 3
  • 26
  • 34