Commit 573b647
committed
I've added
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`.SetDefaultEventParameters and ClearDefaultEventParameters to Analytics for you.1 parent 8ddab84 commit 573b647
File tree
3 files changed
+5
-5
lines changed- analytics/src
- include/firebase
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
0 commit comments