User Profile (iOS SDK)

PersonaClick | AI-based Omnichannel Marketing Platform

User Profile (iOS SDK)

Update User Profile

Method Objective

The method updates the user's profile or creates a new profile bound to the user's current device if it was not created earlier.

If you don't have user data, never send bogus data. It'll cause problems in profile handling in the future. For example, don't send a non-existent email, like anonymous@example.com, or an automatically generated email address that doesn't have anything to do with the user's actual email.

Syntax and parameters

 sdk.setProfileData(params) { callback }

NameRequirementDescription
paramsrequiredObject with request parameters.
callbackoptionallyCallback Function

Request Parameters

Name

Description

userEmail

User Email.

firstNameUser First Name.
genderUser Gender (m – male, f – female).
userLoyaltyIdThe Loyalty Program user ID (loyalty card).
lastNameUser Surname.
userPhone

User Phone.

A phone number in full international format may begin with a plus sign (+) followed by the country code, city (area) code, and phone number.

userIdStore side user ID
birthdayUser birthday in the format YYYY-MM-DD.
ageUser age (in years).
locationThe user's current location from the list of locations in the product feed.
customProperties

Dictionary of custom properties. The custom property must be created before it can be used. Located there: Account > Settings > Profile Property

If property creation isn't available in the account, contact PersonaClick support.

Example of use

# custom properties
let stringArray = ["item1", "item2", "item3"]
let intArray = [1, 2, 3, 4, 5]
let floatArray: [Float] = [1.1, 2.2, 3.3]
let boolArray = [true, false, true]
let dateArray = [Date(),Date(),Date()]
let object: [String: Any] = [
  "stringKey": "stringValue",
  "intKey": 123,
  "floatKey": 45.67,
  "boolKey": true,
  "dateKey": Date(),
  "arrayKey": [1, 2, 3],
  "nestedObjectKey": [
      "nestedStringKey": "nestedValue",
      "nestedIntKey": 456
  ]
]

let customProperties: [String: Any] = [
    "string_prop": "string_value",
    "integer_prop": 123,
    "float_prop": 7.62,
    "date_prop": "2021-12-31 23:55:00",
    "stringArray": stringArray,
    "intArray": intArray,
    "floatArray": floatArray,
    "boolArray": boolArray,
    "dateArray": dateArray,
    "customObject": object
]

sdk.setProfileData(
    userEmail: "john.doe@examplemail.com",
    userPhone: "4400114527199",
    userLoyaltyId: "000001234567",
    birthday: "1990-03-11",
    age: "31",
    firstName: "John",
    lastName: "Doe",
    userId: "extID100500",
    location: "NY",
    gender: "m",
    customProperties: customProperties
) { (profileDataResp) in
      print("Profile data callback")
}


Get Device ID of Current Profile

Method Objective

The method allows getting the Device ID of the current profile.

Syntax

 sdk.getDeviceID()

Example of use

var deviceId = sdk.getDeviceID()

Copyright 2018-2025 PersonaClick