Closed davipedrosa closed 6 years ago
Hi @davipedrosa, thanks for the bug report.
We could update the function like this, what do you think?
@objc public func trackSearch(query: String, category: String?, resultCount: Int, url: URL? = nil) {
trackSearch(query: query, category: category, resultCount: resultCount, dimensions: [], url: url)
}
Sure, I think it will solve the problem. Thank you.
@davipedrosa Thanks a lot. This got fixed and will be part of the next release.
Thanks. If people like me would want to use this feature with the current version (5.2.0), add this to your project :
extension MatomoTracker
{
@objc public func trackSearchWithNoInfiniteLoop(query: String, category: String?, resultCount: Int, url: URL? = nil) {
trackSearch(query: query, category: category, resultCount: resultCount, dimensions: [], url: url)
}
}
Then call like this in your code:
matomoTracker.trackSearchWithNoInfiniteLoop(query: query, category: nil, resultCount: nbResults)
When I call the method trackSearch(query:category:resultCount:url:) in file MatomoTracker.swift, an EXC_BAD_ACCESS error is thrown. I noticed the method is repeatedly calling itself.
Below is its current implementation:
@objc public func trackSearch(query: String, category: String?, resultCount: Int, url: URL? = nil) { trackSearch(query: query, category: category, resultCount: resultCount, url: url) }}