Closed mscwilson closed 2 years ago
This pull request is for issue #340.
For the tracker creation, I'm not sure what to do with Subject. The default Subject config - whether config object or builder - sets the timezone. Therefore createTracker(trackerConfig, networkConfig, emitterConfig, new SubjectConfiguration())
and createTracker(trackerConfig, networkConfig, emitterConfig, null)
aren't the same. Is it a problem if the timezone gets set? Might be unexpected.
I don't know why Subject has that one default setting. Bit messy.
@mscwilson I was going to suggest to just keep the behaviour to always set the default Subject with the current timezone (as does the Android tracker) but thinking about this a bit more I think that unless the user passes a Subject instance, we should not create a default one. Since we expect the tracker to run in a server setting, the default Subject properties would relate to the current server which is probably not what the user wants (they want the client timezone). So I would set the SubjectConfiguration to NULL in createTracker()
functions where the Subject is not explicitly passed.
This PR adds a couple of API improvements. A
Snowplow
class has been added with static methods for creating and managing multiple trackers.Also, configuration classes have been added to bring this tracker more in line with the Android and C++ trackers. In conjunction with the Snowplow class, it's now very easy to create a tracker with default configuration, or to set custom choices.