Patch for profile key enums mismatching #143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
iOS SDK does not use enums for profile identifiers
external_id
,email
andphone_number
and isn't intended to consume identifiers withsetProfileAttribute
. Since RN is exposing those enums cross-platform, it is reasonable a developer could expect to set identifiers with that method. But we discovered that could lead to an iOS issue with identifiers not getting tracked in internal state when set viasetProfileAttribute
, though the identifier still makes it to the backend for that profile.To resolve this confusion, we're deprecating these enums on android and RN to discourage setting identifiers via the attribute setter method. In a future release we will delete them entirely, but in the mean time updated the bridging behavior to direct any identifiers set with these profile keys to use the explicit setter functions.
Check List
Yes it is a change to the SDK's API, but a deprecation is backward compatible.
Changelog / Code Overview
setProfileAttribute
with an identifier enum will be routed to the correct setter function (consistent with how android would behave)Test Plan
Tested with the example app with and without this change.
Related Issues/Tickets
Related android PR klaviyo/klaviyo-android-sdk#150
CHNL-7225