Commit b2b225d
committed
Add SetDefaultEventParameters and ClearDefaultEventParameters to Analytics
This change introduces two new C++ Analytics SDK functions:
- `SetDefaultEventParameters(const std::map<std::string, Variant>& params)`:
Allows setting 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. Passing only invalid
parameters resulting in an empty parameter set is a no-op on iOS/Android.
- `ClearDefaultEventParameters()`: Clears all currently set default event
parameters.
Platform implementations:
- iOS: Uses `[FIRAnalytics setDefaultEventParameters:]`. `Variant::Null()`
maps to `[NSNull null]`. Unsupported types are skipped.
- 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.
Unit tests and integration tests have been reviewed and updated. Integration
test names have been clarified.
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.
Code formatting applied using the project's script.
Release notes in `release_build_files/readme.md` updated and shortened.1 parent 573b647 commit b2b225d
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
0 commit comments