Skip to content
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

Merged
merged 10 commits into from
Oct 18, 2024
Merged

Conversation

a-maurice
Copy link
Contributor

Description

Provide details of the change, and generalize the change in the PR title above.

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

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

@a-maurice a-maurice added the tests-requested: quick Trigger a quick set of integration tests. label Oct 17, 2024
@a-maurice a-maurice added tests-requested: quick Trigger a quick set of integration tests. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 17, 2024
@a-maurice a-maurice added tests-requested: quick Trigger a quick set of integration tests. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 17, 2024
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Integration test with FLAKINESS (succeeded after retry)

Requested by @a-maurice on commit 9906aa9
Last updated: Thu Oct 17 19:30 PDT 2024
View integration test log & download artifacts

Failures Configs
firestore [TEST] [FLAKINESS] [iOS] [macos] [1/2 ios_device: ios_target]
(1 failed tests)  QueryTest.TestLimitQueriesUsingDescendingSortOrder

Add flaky tests to go/fpl-cpp-flake-tracker

@github-actions github-actions bot added the tests: succeeded This PR's integration tests succeeded. label Oct 17, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Oct 17, 2024
env->NewObject(util::bundle::GetClass(),
util::bundle::GetMethodId(util::bundle::kConstructor));
for (const auto& pair : map) {
// Only add elements that use a string key
Copy link
Contributor

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?

Copy link
Contributor Author

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.

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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.

@a-maurice a-maurice merged commit 9906aa9 into main Oct 18, 2024
28 checks passed
@a-maurice a-maurice deleted the am-analytics_parameters branch October 18, 2024 00:04
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: succeeded This PR's integration tests succeeded. and removed tests: succeeded This PR's integration tests succeeded. labels Oct 18, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Oct 18, 2024
@firebase firebase locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests: succeeded This PR's integration tests succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants