Previously, setAnonymousId could only be used to set the anonymousId after the SDK is init. If someone wants to set the ID before the SDK init then they need to pass the ID in the Configuration object. This behaviour doesn't align with the v1. Also, IMO, the setting of ID should not be part of the SDK configuration. And since we have a dedicated API to set this value, we should be utilising that API.
About the change
In this PR, we have made the existing setAnonymousId internal, in order to restrict the user from calling this API.
Introduced a new setAnonymousId API similar to v1 which can be utilised to set the advertisingId either before or after the SDK init. This behaviour is in alignment with v1.
Next change (Once this PR proposal is approved)
We need to remove the anonymousId from the Configuration class.
Make similar changes for other APIs e.g., putDeviceToken, putAdvertisingId etc.
Fixes # (issue)
Type of change
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
Checklist:
[ ] Version upgraded (project, README, gradle, podspec etc)
[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have added unit tests for the code
[ ] I have made corresponding changes to the documentation
About the issue
setAnonymousId
could only be used to set theanonymousId
after the SDK is init. If someone wants to set the ID before the SDK init then they need to pass the ID in the Configuration object. This behaviour doesn't align with the v1. Also, IMO, the setting of ID should not be part of the SDK configuration. And since we have a dedicated API to set this value, we should be utilising that API.About the change
setAnonymousId
internal, in order to restrict the user from calling this API.setAnonymousId
API similar to v1 which can be utilised to set theadvertisingId
either before or after the SDK init. This behaviour is in alignment with v1.Next change (Once this PR proposal is approved)
anonymousId
from theConfiguration
class.putDeviceToken
,putAdvertisingId
etc.Fixes # (issue)
Type of change
Checklist: