I'm trying to log a few events, but the console is telling me there are errors. Here's a couple of events I'm trying to log:
Analytics.logEvent("workout_velocities", parameters: [
"workout_uuid": UUID().uuidString,
"speed": [
"2018-02-22 07:46:37 +0000": -1,
"2018-02-22 07:46:38 +0000": -1,
"2018-02-22 07:46:39 +0000": -1
]
])
I get the following error message:
2018-02-21 23:52:42.480336-0800 RunManager[1878:1120392] 4.8.1 - [Firebase/Analytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber or NSString. Value: {
"2018-02-22 07:46:37 +0000" = "-1";
"2018-02-22 07:46:38 +0000" = "-1";
"2018-02-22 07:46:39 +0000" = "-1";
}
2018-02-21 23:52:42.480414-0800 RunManager[1878:1120392] 4.8.1 - [Firebase/Analytics][I-ACS016000] Event parameter value must be of type NSString or NSNumber. Type: _TtGCs26_SwiftDeferredNSDictionarySSSi_
Please read the API documentation for Analytics.logEvent(). For the parameters argument it says:
The dictionary of event parameters. Passing nil indicates that the event has no parameters. Parameter names can be up to 40 characters long and must start with an alphabetic character and contain only alphanumeric characters and underscores. Only NSString and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are supported. NSString parameter values can be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not be used for parameter names.
Your argument doesn't meet the stated requirements. It appears you're passing a dictionary with values containing things other than strings and numbers. Specifically, you're passing a "speed" value which contains yet another dictionary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With