Skip to content

Commit

Permalink
Added timeout property to URLSessionDispatcher init method (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisnikovRoman authored and brototyp committed Sep 20, 2019
1 parent 29e3824 commit 7d6804f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 7.0.2
* **improvement** Added `timeout` property to URLSessionDispatcher initialization method

## 7.0.1
* **bugfix** Fixed an issue with a new `forcedVisitorId` value validation. [#315](https://github.com/matomo-org/matomo-sdk-ios/pull/315)

Expand Down
5 changes: 3 additions & 2 deletions MatomoTracker/URLSessionDispatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public final class URLSessionDispatcher: Dispatcher {
/// - Parameters:
/// - baseURL: The url of the Matomo server. This url has to end in `piwik.php`.
/// - userAgent: An optional parameter for custom user agent.
public init(baseURL: URL, userAgent: String? = nil) {
/// - timeout: The timeout interval for the request. The default is 5.0.
public init(baseURL: URL, userAgent: String? = nil, timeout: TimeInterval = 5.0) {
self.baseURL = baseURL
self.timeout = 5
self.timeout = timeout
self.session = URLSession.shared
if let userAgent = userAgent {
self.userAgent = userAgent
Expand Down

0 comments on commit 7d6804f

Please sign in to comment.