Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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.
Note |
---|
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 |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
sdk.setProfileData(params) { callback } |
Name | Type | Requirement | Description |
---|---|---|---|
params | HashMap | required | Object with request parameters. |
callback | function | optionally | Callback Function |
Request Parameters
Name | Type | Description | ||||
---|---|---|---|---|---|---|
userEmail | string | User Email. | ||||
firstName | string | User First Name. | ||||
gender | string | User Gender (m – male, f – female). | ||||
userLoyaltyId | string | The Loyalty Program user ID (loyalty card). | ||||
lastName | string | User Surname. | ||||
userPhone | string | User Phone. | ||||
birthday | string | User birthday in the format YYYYY-MM-DD. | ||||
age | string | User age (in years). | ||||
location | string | The user's current location from the list of locations in the product feed. | ||||
customProperties | Dictionary [string: string] | Dictionary of custom properties. The custom property must be created before it can be used. Located there: Account > Settings > Profile Property
|
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
sdk.setProfileData( userEmail: "john.doe@examplemail.com", userPhone: "4400114527199", userLoyaltyId: "000001234567", birthday: "1990-03-11", age: "31", firstName: "John", lastName: "Doe", location: "NY", gender: "m", customProperties: [ "property1": "value1", "property2": "value2", "property3": "value3" ] ) { (profileDataResp) in print("Profile data callback") } |
Anchor | ||||
---|---|---|---|---|
|
Method Objective
The method allows getting the Device ID of the current profile.
Syntax
Code Block | ||||
---|---|---|---|---|
| ||||
sdk.getDeviceID() |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
var deviceId = sdk.getDeviceID() |
Column | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Page Navigation
Related Pages
|