Cordova app can't make JSONP AJAX request - 401 error


For some reason, the desktop version of my app works fine, but the mobile one does not. I’m making this call from the client:

    $.ajax(`${apiBaseUrl}/get_recent_posts`, {
      dataType: 'jsonp'
    }).done(function (data) {
      console.log('done, firing callback');
    }).fail(function (jqXHR, textStatus, errorThrown) {
      console.log('FAIL. dumping everything!');
    }).always(function (jqXHR, textStatus, errorThrown) {

And getting this error in the Safari console:

Failed to load resource: the server responded with a status of 401 (Unauthorized

It’s interesting to note that neither done, fail, nor always fire. Why would the desktop version work but the mobile one not?


I encountered the same problem that ajax called to my .NET WebAPI works on desktop, but not on iOS 10 iPhone 6 Plus.
If any one know what needs to be done please let us know.

Thank you in advanced.