PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
32 stars 41 forks source link

Add shouldSendDeviceID to PHGPostHogConfiguration. #21

Closed pixlwave closed 2 years ago

pixlwave commented 2 years ago

What does this PR do? Allows users of the library to opt out of sending a $device_id property by adding a shouldSendDeviceID to PHGPostHogConfiguration. The default value of this property is YES so there is no change to the standard behaviour.

Where should the reviewer start? PHGPostHogConfiguration.h

How should this be manually tested? Create a PHGPostHogConfiguration and set shouldSendDeviceID to NO/false before using it to create/setup the PostHog client. Observe that when disabled, no $device_id property is seen.

Any background context you want to provide? I think it should be clear enough what I'm trying to do. Happy to rename if you have better suggestions (could be disableDeviceID perhaps).

What are the relevant tickets? N/A

Screenshots or screencasts (if UI/UX change) N/A

Questions:

Edit: This seems like the kind of change that would be useful to have a test for, however I don't have any experience using Quick/Nimble so haven't added one to the PR.