-
Notifications
You must be signed in to change notification settings - Fork 32
[FSSDK-9433]: Adds support to override sdkName and sdkVersion for events #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider to change Utils.sdkVersion
and Utils.swiftSdkClientName
to reflect when customized? Then we may not need the changes in other codes.
@@ -84,12 +86,13 @@ open class OptimizelyClient: NSObject { | |||
odpManager: OdpManager? = nil, | |||
defaultLogLevel: OptimizelyLogLevel? = nil, | |||
defaultDecideOptions: [OptimizelyDecideOption]? = nil, | |||
settings: OptimizelySdkSettings? = nil) { | |||
settings: OptimizelySdkSettings? = nil, | |||
clientName: String? = nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this new option into OptimizelySdkSettings
? It's not a common configuration usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to config "sdkVersion" as well.
We can use "sdkName" and "sdkVersion" to be consistent with android-sdk?
@@ -744,7 +750,7 @@ open class OptimizelyClient: NSObject { | |||
throw OptimizelyError.eventKeyInvalid(eventKey) | |||
} | |||
|
|||
sendConversionEvent(eventKey: eventKey, userId: userId, attributes: attributes, eventTags: eventTags) | |||
sendConversionEvent(eventKey: eventKey, userId: userId, attributes: attributes, eventTags: eventTags, clientName: self.clientName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can change Utils.sdkVersion
and Utils.swiftSdkClientName
to update when customize. In that way, we do not change these apis.
@@ -285,7 +289,8 @@ open class OptimizelyClient: NSObject { | |||
attributes: attributes, | |||
flagKey: "", | |||
ruleType: Constants.DecisionSource.experiment.rawValue, | |||
enabled: true) | |||
enabled: true, | |||
clientName: clientName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before. If we change Utils.sdkVersion
, no need for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
We also need a test case validating ODPEvent which includes sdk name and version.
Utils.sdkVersion = OPTIMIZELYSDKVERSION | ||
Utils.swiftSdkClientName = "swift-sdk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this lines for testing? It may be more interesting without them to check if all works fine with default config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Test plan
Issues