mike4aday / SwiftlySalesforce

The Swift-est way to build native mobile apps that connect to Salesforce.
MIT License
136 stars 43 forks source link

Timeout interval #105

Closed auctifera-josed closed 4 years ago

auctifera-josed commented 5 years ago

Is there any way to modify the timeoutInterval of the URLRequest struct?

I've some APEX rest services that defaults to the maximum timeout (2 mins) and the app defaults to 1 min, I've edited the RESTResource.swift that extends RESTResource and set req.timeoutInterval = 140 (just to give it a few more seconds than 2 mins) but I guess this could be a useful feature.

mike4aday commented 5 years ago

Thanks @auctifera-josed -- this is a great idea. I'll mark it as an 'enhancement.'

mike4aday commented 4 years ago

@auctifera-josed this is delivered in version 8.0. You can now provide your own URLSession to any request and set the timeout interval - and lots of other properties via URLSessionConfiguration.

See RequestConfig struct, and how it can be used, for example, in Salesforce.identity(config:).