Skip to content

Commit 2293bcb

Browse files
committed
feat: objc-native timeout option
1 parent 4224606 commit 2293bcb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/targets/objc/native.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

33
module.exports = function (options) {
4+
var opts = util._extend({
5+
timeout: '10'
6+
}, options);
7+
48
var code = [];
59

610
// Dependencies
@@ -11,7 +15,7 @@ module.exports = function (options) {
1115
// Create request object
1216
code.push('NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"' + this.source.fullUrl + '"]');
1317
code.push(' cachePolicy:NSURLRequestUseProtocolCachePolicy');
14-
code.push(' timeoutInterval:10.0];');
18+
code.push(' timeoutInterval:' + parseInt(opts.timeout, 10).toFixed(1) + '];');
1519
code.push('[request setHTTPMethod:@"' + this.source.method + '"];');
1620

1721
// Set headers

0 commit comments

Comments
 (0)