diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b93fc5c..d31a5f89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/MatomoTracker/URLSessionDispatcher.swift b/MatomoTracker/URLSessionDispatcher.swift index 3e515e4d..e90c67e9 100644 --- a/MatomoTracker/URLSessionDispatcher.swift +++ b/MatomoTracker/URLSessionDispatcher.swift @@ -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