-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add logic for Analytics parameters with maps #1660
Conversation
Integration test with FLAKINESS (succeeded after retry)Requested by @a-maurice on commit 9906aa9
Add flaky tests to go/fpl-cpp-flake-tracker |
env->NewObject(util::bundle::GetClass(), | ||
util::bundle::GetMethodId(util::bundle::kConstructor)); | ||
for (const auto& pair : map) { | ||
// Only add elements that use a string key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making sure there are no numeric keys allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it is currently only strings, and I doubt that'll change any time soon.
analytics/src/analytics_ios.mm
Outdated
NSDictionary* MapToDictionary(const std::map<Variant, Variant>& map); | ||
|
||
// Converts the given vector into an ObjC NSArray of ObjC objects. | ||
NSArray* VectorToArray(const std::vector<Variant>& vector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the Android version above) seem slightly misnamed since they are specifically for converting a vector of maps to an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, renamed to VectorOfMapsToArray. Originally on iOS I converted everything, but on Android that isn't as feasible with how the ArrayList works, and then looking over the parameters the only times Arrays are used are with Dictionaries, so went with that.
Description
Add support for Parameters of maps and lists of maps. This is needed for a handful of Analytics events, like ViewCart https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=18167566225038720690-NC&client_type=gtag#view_cart
Testing
Type of Change
Place an
x
the applicable box:Notes
Release Notes
section ofrelease_build_files/readme.md
.