Majchrzak / Flurry-Unity-3D

Flurry iOS and Android plugin for Unity 3D.
MIT License
64 stars 33 forks source link

Extra empty parameter sent on iOS #8

Closed Blundig closed 7 years ago

Blundig commented 9 years ago

On iOS, when using LogEvent with event parameters, an extra parameter with key:value == "":"" is added to the dictionary and sent with the event.

The problem is with FlurryIOS.ToKeyValue(). When it converts the Dictionary<string, string> to strings, it adds a '\n' to the start of each string. When converted back to a Dictionary in Objective-C, this newline is converted to an empty entry.

Instead, that method's logic should be changed to something like this:

int i = 0; foreach (KeyValuePair<string, string> pair in dictionary) { if (i++ == 0) { keys = pair.Key; values = pair.Value; } else { keys = string.Format("{0}\n{1}", keys, pair.Key); values = string.Format("{0}\n{1}", values, pair.Value); } }