-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another PR for Feature/custom variables #223
Another PR for Feature/custom variables #223
Conversation
…o feature/CustomVariables # Conflicts: # PiwikTracker/URLSessionDispatcher.swift
…o manage Custom Variables
The last point is implemented in #224. |
Hi @manuroe, Awesome. Thank you for your work. To the 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 |
Awesome! Thanks. |
@manuroe I've just seen, that there is no Changelog entry. Do you want to be named there? |
@brototyp, yes please. |
* PiwikTracker.isOptedOut property visible to objc * custom variables added to Tracker and Event for per-visit and per-event scoping * CustomVariables code documentation * Objective-C accessibility for Custom Dimensions, Code documentation. * Objective-C accessibility for PiwikTracker.dispatchInterval * Custom Variable: add the "index" member and update PiwikTracker API to manage Custom Variables * Custom Variable: Remove PiwikTracker.getDefaultCVars() as it is very app specific * Custom Variable: rename cvars to customVariables * Custom Variable: take into account remark at https://github.com/matomo-org/matomo-sdk-ios/pull/205/files#r154520132 * Custom Variable: Make EventSerializer.customVariableParameterValue() more readable
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.