AttributesEditor
Identity
IdentityEditor
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
The Identity class is an immutable representation of a user’s identity within the Salesforce Marketing Cloud SDK. It encapsulates user identification information including profile ID, party identification details, and custom attributes.
To obtain an Identity instance:
1SFMCSdk.requestSdk { sdk -> sdk.identity }Two methods are available for updating identity:
edit function| Property | Type | Description |
|---|---|---|
profileId | String? | Unique identifier for user profile (Marketing Cloud Engagement) |
partyIdentificationName | String? | User’s display name or full name (Mobile App Messaging) |
partyIdentificationNumber | String? | Unique identifier number for user (Mobile App Messaging) |
partyIdentificationType | String? | User’s category or classification (Mobile App Messaging) |
attributes | Map<String, String?> | Custom attributes map (shared by both services) |
registrationId | String | Registration identifier |
1class BuilderProvides a fluent API for setting identity properties and creating new Identity instances.
1fun edit(editor: IdentityEditor.() -> Unit): BooleanKotlin DSL syntax for modifying Identity properties through an IdentityEditor.
Parameters:
editor: Lambda function providing DSL editing interfaceReturns: Boolean indicating success of the edit operation
1fun newBuilder(): Identity.BuilderCreates a new Builder instance initialized with current identity values, enabling modifications.
Returns: Identity.Builder instance for updating properties
1fun toJson(): JSONObjectSerializes the Identity to a JSONObject representation, including platform, profile ID, installation ID, party identification details, and attributes.
Returns: JSONObject containing all identity properties
1open operator override fun equals(other: Any?): BooleanStandard equality comparison implementation.
1open override fun hashCode(): IntStandard hash code implementation.
1open override fun toString(): StringString representation of the identity.