liferay / liferay-mobile-sdk

Other
47 stars 56 forks source link

NSURLSession connectionTimeout #48

Closed wolfAle closed 6 years ago

wolfAle commented 7 years ago

Hi all,

Environment: iOS SDK Version: 7.0.12

LRSession enables to configure a custom connectionTimeout value, that I expect to be used in the concrete NSURLRequest. Today I found out that it's not the case because in + (void)_sendAsynchronousRequest(NSURLRequest *)request session:(LRSession *)session { the session.connectionTimeout value is ignored and the NSURLSession is created with a default NSURLSessionConfiguration object that has a value of 60 for timeoutIntervalForRequest.

This is obviously misleading and doesn't allow the developer to setup the value it needs for the timeout. Would be great to have this fixed and it would be even better to have two different values to setup, such as in NSURLSessionConfiguration: timeoutIntervalForRequest and timeoutIntervalForResource.

What do you think about it guys? Is there any other way to setup the timeout that I didn't find out?

Let me know if you needed anything else from my side.

Kind Regards, Alessandro

wolfAle commented 6 years ago

Hi guys,

any news here?

Thanks, Alessandro

victorg1991 commented 6 years ago

Hey @wolfAle What do you think about trying to implement it yourself? I can help you in anything you need

wolfAle commented 6 years ago

Hi @victorg1991,

sure thing, I've already used a workaround with method swizzling to get there, I'll create a push request with that code (without method swizzling of course).

Thanks

victorg1991 commented 6 years ago

Nice, thank you so much! :D