TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
149 stars 30 forks source link

Implement `analyticsDisabled` to allow an opt out of analytics #76

Closed kimar closed 1 year ago

kimar commented 1 year ago

Rationale

Provides a way to opt out of analytics by settings the value of analyticsDisabled to true on the configuration.

Considerations

I've considered just re-using the swiftUIPreviewMode and setting it to true whenever I want to opt out of sending signals, however as I'm storing the opt-out state in the App's user defaults, if I'm using this value during development it might emit events signals in SwiftUIPreviews as well. To not interfere with this preference I've create the above mentioned property.

Final words

Given this Pr is of interested and this feature will be implemented, I'm happy to also implement this in the Kotlin and JS SDKs.

winsmith commented 1 year ago

Hi this is an excellent idea and I love it! Thanks you very much for this PR!