Added support for TntId setter API#116
Conversation
sbenedicadb
left a comment
There was a problem hiding this comment.
looks good with a couple of nit items.
curious why we are storing "empty" tntId as empty string, but "empty" edgeHost as nil
| } | ||
| } | ||
|
|
||
| /// Sets the Test and Target user identifier. |
There was a problem hiding this comment.
i think we should remove "Test" from this summary. it's just "Target" these days, or maybe "Adobe Target"?
| /// | ||
| /// - Parameter id: a string containing the value of the Tnt Id to be set in the SDK. | ||
| static func setTntId(_ id: String?) { | ||
| let eventData = [TargetConstants.EventDataKeys.TNT_ID: id ?? ""] |
There was a problem hiding this comment.
since it's an optional param, it's good to also indicate in the doc what happens when id is nil
| /// and is removed at uninstall, upon privacy status update to opt out or when AEPTarget.resetExperience is called. | ||
| /// | ||
| /// - Parameter id: a string containing the value of the Tnt Id to be set in the SDK. | ||
| static func setTntId(_ id: String?) { |
There was a problem hiding this comment.
do we need to expose this for objc?
There was a problem hiding this comment.
It is visible in objc, I've updated the objc testapp as well.
AEPTarget/Sources/Target.swift
Outdated
| if tntIdValuesAreEqual(newTntId: tntId, oldTntId: targetState.tntId) { | ||
| Log.debug(label: Target.LOG_TAG, "setTntId - New tntId value is same as the existing tntId \(String(describing: targetState.tntId)).") | ||
| if tntId == targetState.tntId { | ||
| Log.debug(label: Target.LOG_TAG, "setTntIdInternal - New tntId value is same as the existing tntId \(String(describing: tntId)).") |
There was a problem hiding this comment.
nit: some of these debug logs could be moved to trace
There was a problem hiding this comment.
I believe we need some of these as debug logs to interpret the different scenarios. Added a trace log as well.
| /// The provided Tnt Id is persisted in the SDK and attached to all subsequent Target requests. It is used to | ||
| /// derive the edge host value in the SDK, which is also persisted and used in future Target requests. | ||
| /// | ||
| /// If the provided Tnt Id is nil or empty, the SDK will remove the Tnt Id and edge host values from persistence. |
… into MOB-16757 # Conflicts: # AEPTarget.xcodeproj/project.pbxproj # AEPTarget/Sources/Target+PublicAPI.swift # AEPTarget/Sources/Target.swift # AEPTarget/Sources/TargetConstants.swift # AEPTarget/Tests/IntegrationTests/TargetIntegrationTests.swift # AEPTarget/Tests/UnitTests/Target+PublicAPITests.swift # AEPTargetDemoApp/ContentView.swift
* Added support for Target session Id setter & getter (#115) * Added support for Target session Id setter/ getter * code cleanup * Fixed formatting issue * Incorporated feedback * Incorporated feedback * Added support for TntId setter API (#116) * Added support for Target session Id setter/ getter * code cleanup * Fixed formatting issue * Added support for Target tntId setter * code cleanup * fixed formatting * fixed definition conflict test issue * Incorporated feedback * Incorporated feedback * Using distinct Event name * More testapp updates * Release prep v3.2.0 (#117) * release prep v3.2.0 * Feedback updates * Dependency and doc updates * Incorporated feedback * Fixed issue: Persisted edge host value was not used for Target request issued upon app close & relaunch (#119) * Fixed an issue where persisted edge host value was not used for Target request issued upon app close & relaunch * minor doc update * Target doc updates (#120) * Target doc updates * docs cleanup
Description
[Ref: MOB-16757]
func setTntId(_ id: String?)
Swift testapp

ObjectiveC testapp

Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: