iOS SDK does not use enums for profile identifiers external_id, email and phone_number and isn't intended to consume identifiers with setProfileAttribute. 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 via setProfileAttribute, 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
[x] Are you changing anything with the public API?
[x] Are your changes backwards compatible with previous SDK Versions?
Yes it is a change to the SDK's API, but a deprecation is backward compatible.
Changelog / Code Overview
Added a patch to the swift bridge file so that using setProfileAttribute with an identifier enum will be routed to the correct setter function (consistent with how android would behave)
Deprecated the enums with warning, to be removed in next release.
Test Plan
Tested with the example app with and without this change.
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 https://github.com/klaviyo/klaviyo-android-sdk/pull/150 CHNL-7225