Using Cordova 8.0.0, iOS 12.1.2, trying to make a GET request to my server.
I can make requests successfully to the server, but if for whatever reason it takes longer than 10 seconds then it fails. It DOES work if it takes any amount of time less than that.
This only occurs for me in iOS, the Android build of the app does not show this behaviour and respects the timeout I've set below.
Example snippet:
$.ajax({
type: "GET",
url: actionUrl,
data: data,
cache: false,
dataType: "xml",
timeout: 300000,
async: false,
beforeSend: function (request) {
request.setRequestHeader("user", settings.userId);
request.setRequestHeader("sid", settings.sessionKey);
},
success: function (results) {
callback(results);
},
error: function (e) {
if (!surpressError){
main.ajaxError(e);
}
main.stopLoading();
if (errorCallback){
errorCallback(e);
}
}
});
If I make async: true
or just take that bit out, the request CAN take longer than 10 seconds to complete but with this legacy app I'd rather not have to change more of it around than I have to to accommodate the switch.
I've also tried adding <preference name="loadUrlTimeoutValue" value="300000" />
to my config.xml, and timeouts of less than 1 minute (30000) but that does not help.
Is there another way I can ensure the timeout is longer than 10 seconds that I have missed?