segment-integrations / analytics-ios-integration-firebase

Segment's bundled integration for Firebase on iOS
MIT License
13 stars 92 forks source link

Formats trait values to trim spaces instead of replacing them with underscore #19

Closed cem2ran closed 6 years ago

cem2ran commented 6 years ago

I found it quite odd behaviour to format values such that spaces are replaced with underscore. If I were to send the name of the user or similar I would have the following as the value: 'Cem_Turan' instead of 'Cem Turan'.

This PR changes the behaviour such that surrounding whitespaces and new lines are trimmed.

ladanazita commented 6 years ago

Hi @cem2ran ,

When building this, we found Firebase referenced using underscores in their documentation. It seems consistently used throughout their documentation, for example here.

Did you find evidence that this isn't the case?

Thanks! Ladan

cem2ran commented 6 years ago

@ladanazita As far as I can tell there's only evidence for the trait name being underscored. Not the actual value. All values are referenced as variables, which you must presume has whatever format you feel is right.

ladanazita commented 6 years ago

Make sense, can you also update the tests @cem2ran to coincide with the changes? Thanks!

cem2ran commented 6 years ago

Sure thing.

ladanazita commented 6 years ago

Hi @cem2ran I'm sorry for the delay here. I will get this out this week!

ladanazita commented 6 years ago

@cem2ran This will be live on version 2.1.0. Thanks for the contribution and your patience here!