Commit b6da98c
committed
Add SetDefaultEventParameters and ClearDefaultEventParameters to Analytics
This change introduces two new C++ Analytics SDK functions:
- `SetDefaultEventParameters(const std::map<std::string, firebase::Variant>& params)`:
Allows setting default parameters (string, int64, double, bool, null)
that will be included in all subsequent `LogEvent` calls.
If a `firebase::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()`: Clears all currently set default event
parameters.
Platform implementations:
- iOS: Uses `[FIRAnalytics setDefaultEventParameters:]`. `firebase::Variant::Null()`
maps to `[NSNull null]`. Unsupported types are skipped.
- Android: Uses `FirebaseAnalytics.setDefaultEventParameters(Bundle)`.
`firebase::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 to cover these
functionalities and type constraints.1 parent 032dc37 commit b6da98c
2 files changed
+36
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
644 | 658 | | |
645 | | - | |
646 | | - | |
647 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
648 | 662 | | |
649 | | - | |
650 | 663 | | |
651 | 664 | | |
652 | 665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
395 | 398 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 399 | + | |
| 400 | + | |
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
| |||
0 commit comments