Closed manuroe closed 6 years ago
The last point is implemented in https://github.com/matomo-org/matomo-sdk-ios/pull/224.
Hi @manuroe, Awesome. Thank you for your work. To the getDefaultCVars
: I think the code came from porting over the original, Objective-c code. Back then such a logic was implemented. I am very fine with keeping it as you implemented it and to deprecate such usage.
I will sketch around a bit regarding my comment about the readability.
I thought about serializing it as JSON, but that adds another complexity. The best I could find is the following. What do you think?
private func customVariableParameterValue() -> String {
let customVariableParameterValue: [String] = customVariables.map { "\"\($0.index)\":[\"\($0.name)\",\"\($0.value)\"]" }
return "{\(customVariableParameterValue.joined(separator: ","))}"
}
Your customVariableParameterValue
is fine by me. I have updated the PR.
Awesome! Thanks.
@manuroe I've just seen, that there is no Changelog entry. Do you want to be named there?
Do you want to be named there?
@brototyp, yes please.
Hi,
This PR is the continuation of the work made by @zantoku in PR #205, which is stuck because review remarks have not yet been taken into account.
What I have done in this PR:
getDefaultCVars
method because indexes and names used for these custom variables look like very specific to an app. I have not seen matomo using such default values in other SDKs. So, I have preferred to remove them and let the app set them.This last point will require to make the
Device
struct accessible from objc in order to offer the same functionality as the initial PR. If you are ok, I will make it in another PR.