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
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 that will be included in all subsequent `LogEvent` calls. If a `firebase::Variant::Null()` is provided as a value for a key, that specific default parameter will be cleared/removed.
- `ClearDefaultEventParameters()`: Clears all currently set default event parameters.
Platform implementations:
- iOS: Uses `[FIRAnalytics setDefaultEventParameters:]`. `firebase::Variant::Null()` maps to `[NSNull null]` for clearing individual parameters. Calling with `nil` clears all.
- Android: Uses `FirebaseAnalytics.setDefaultEventParameters(Bundle)`. `firebase::Variant::Null()` results in `Bundle.putString(key, null)`. Calling with a `null` Bundle clears all.
- Stub: Implemented as no-ops.
Unit tests and integration tests have been updated to cover these new functionalities, including the null-value handling for clearing specific parameters and the overall clearing of all parameters.
0 commit comments