Commit 8ddab84
committed
Here's what I've done to add
This change introduces two new C++ Analytics SDK functions:
- `SetDefaultEventParameters(const std::map<std::string, firebase::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 `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()`: This 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.
I've 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`) and integration tests use `firebase::Variant`.
- Internal SDK implementation code uses unqualified `Variant` where appropriate,
relying on the enclosing `firebase` namespace.
I've also 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.1 parent f743e52 commit 8ddab84
File tree
3 files changed
+23
-26
lines changed- analytics/src
3 files changed
+23
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
| 383 | + | |
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
388 | 387 | | |
389 | | - | |
| 388 | + | |
390 | 389 | | |
391 | 390 | | |
392 | 391 | | |
393 | 392 | | |
394 | | - | |
| 393 | + | |
395 | 394 | | |
396 | 395 | | |
397 | 396 | | |
| |||
401 | 400 | | |
402 | 401 | | |
403 | 402 | | |
404 | | - | |
| 403 | + | |
405 | 404 | | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
411 | 410 | | |
412 | | - | |
| 411 | + | |
413 | 412 | | |
414 | 413 | | |
415 | 414 | | |
| |||
441 | 440 | | |
442 | 441 | | |
443 | 442 | | |
444 | | - | |
445 | | - | |
| 443 | + | |
446 | 444 | | |
447 | 445 | | |
448 | 446 | | |
| |||
454 | 452 | | |
455 | 453 | | |
456 | 454 | | |
457 | | - | |
| 455 | + | |
458 | 456 | | |
459 | 457 | | |
460 | 458 | | |
| |||
630 | 628 | | |
631 | 629 | | |
632 | 630 | | |
633 | | - | |
| 631 | + | |
634 | 632 | | |
635 | 633 | | |
636 | 634 | | |
| |||
665 | 663 | | |
666 | 664 | | |
667 | 665 | | |
668 | | - | |
| 666 | + | |
669 | 667 | | |
670 | 668 | | |
671 | 669 | | |
672 | 670 | | |
673 | 671 | | |
674 | 672 | | |
675 | | - | |
| 673 | + | |
676 | 674 | | |
677 | 675 | | |
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
681 | 679 | | |
682 | | - | |
| 680 | + | |
683 | 681 | | |
684 | 682 | | |
685 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
| 253 | + | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | | - | |
| 280 | + | |
282 | 281 | | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
| 288 | + | |
290 | 289 | | |
291 | 290 | | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
| |||
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
383 | | - | |
| 382 | + | |
384 | 383 | | |
385 | 384 | | |
386 | 385 | | |
| |||
397 | 396 | | |
398 | 397 | | |
399 | 398 | | |
400 | | - | |
| 399 | + | |
401 | 400 | | |
402 | 401 | | |
403 | 402 | | |
404 | | - | |
| 403 | + | |
405 | 404 | | |
406 | 405 | | |
407 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
0 commit comments