You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added SetDefaultEventParameters and ClearDefaultEventParameters to Analytics for you.
This change introduces two new C++ Analytics SDK functions:
- `SetDefaultEventParameters(const std::map<std::string, Variant>& params)`:
This allows you to set default parameters (string, int64, double, bool, null)
that will be included in all subsequent `LogEvent` calls.
If a `Variant::Null()` is provided for a key, that specific
default parameter will be cleared. Aggregate types (maps, vectors) are not
supported and will be skipped with an error logged.
- `ClearDefaultEventParameters()`: This clears all currently set default event
parameters.
Here's how it's implemented on different platforms:
- iOS: Uses `[FIRAnalytics setDefaultEventParameters:]`. `Variant::Null()`
maps to `[NSNull null]`. Unsupported types are skipped. Passing an empty
dictionary (if all input params are invalid) is a no-op.
- Android: Uses `FirebaseAnalytics.setDefaultEventParameters(Bundle)`.
`Variant::Null()` results in `Bundle.putString(key, null)`.
Unsupported types are skipped. `AddVariantToBundle` is used for efficiency
with scalar types.
- Stub: Implemented as no-ops.
I've also reviewed and updated the unit tests and integration tests to cover these
functionalities and type constraints.
Namespace usage for `Variant` has been refined:
- Public API (`analytics.h`) uses unqualified `Variant` as it's within the
`firebase` namespace.
- SDK implementation file signatures match `analytics.h` (unqualified `Variant`).
- Internal SDK code uses unqualified `Variant`.
- Integration tests use `firebase::Variant` as they are outside the
`firebase` namespace.
I've applied code formatting using the project's script and updated and shortened the release notes in `release_build_files/readme.md`.
0 commit comments