SwiftSDK icon indicating copy to clipboard operation
SwiftSDK copied to clipboard

Allow users to customize default payloads

Open fireantprincess opened this issue 3 years ago • 2 comments
trafficstars

Some users might want to reduce the default payloads due to privacy concerns.

fireantprincess avatar Dec 09 '21 12:12 fireantprincess

As well as being able to reduce the default payload (from the ones the SDK provides), it would also be nice if clients were able to add their own defaults.

Currently it's possible for clients to add additional items to the payload through the send function ("additionalPayload") but this could lead to some duplication around the app.

It might be nice to have an API such as:

let configuration = TelemetryManagerConfiguration(appID: "<>")
configuration.defaultPayload["uiTheme"] = "dark-mode"

I would then expect uiTheme to be added to every signal sent after that.

Thoughts?

Sherlouk avatar Feb 13 '22 16:02 Sherlouk

Yes! @kkostov created a similar architecture in the Kotlin SDK, where you can register individual "enrich" functions with the client, and each enrich function will get a chance to add to the payload before it gets sent. When we're next rethinking the Swift Client, we're planning to use this architecture as well.

winsmith avatar Feb 14 '22 12:02 winsmith