AttributesEditor
Identity
IdentityEditor
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Package: com.salesforce.marketingcloud.sfmcsdk.components.identity
Platform: androidJvm
The AttributesEditor class wraps the Identity.Builder attribute map functions to provide an idiomatic Kotlin syntax for managing user attributes in the Salesforce Marketing Cloud SDK.
1SFMCSdk.requestSdk { sdk ->
2 sdk.identity.edit {
3 attributes["key"] = "value" // assignment syntax
4 attributes += "key2" to "value2" // plus assignment syntax
5 }
6}1constructor(builder: Identity.Builder)Creates an instance that wraps an Identity.Builder for attribute operations.
Parameters:
builder - The Identity.Builder instance to wrap1fun clear(vararg keys: String)Clears the value of the specified attributes, effectively setting them to null.
Parameters:
keys - Variable number of attribute keys to clear1fun clear(keys: List<String>)Clears the value of the specified attributes, effectively setting them to null.
Parameters:
keys - List of attribute keys to clear1fun clear(key: String)Clears the value of the specified attribute, effectively setting it to null.
Parameters:
key - The attribute key to clear1fun clearAll()Clears the value of all attributes, effectively setting them to null.
1operator fun plusAssign(entry: Pair<String, String?>)Updates or adds the value of an entry for the given key in the attribute map using the += operator.
Parameters:
entry - A Pair containing the key and nullable value to add/update1fun put(key: String, value: String?)Updates or adds the value of an entry for the given key in the attribute map.
Parameters:
key - The attribute keyvalue - The nullable attribute value1fun putAll(from: Map<out String, String?>)Updates or adds all the values from the passed in map.
Parameters:
from - Map of attributes to add/update1fun set(from: Map<out String, String?>)First clears the values of all existing attributes. Then updates or adds the values from the passed in map.
Note: Attribute keys cannot be removed, only the value can be cleared or set to null.
Parameters:
from - Map of attributes to set1operator fun set(key: String, value: String?)Updates or adds the value of an entry for the given key in the attribute map using array-style indexing syntax.
Parameters:
key - The attribute keyvalue - The nullable attribute value